This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Traffic Manager

To optimize the system, there is a special class called "TrafficManager", which controls simulation in the specified area. It can randomly and automatically place cars and pedestrians only inside the specified area.

When the object escapes the simulation area, it will be disabled and will not waste resources, which will significantly increase performance. It also allows for the creation of dense traffic around the simulation object in the specified radius.

To set a Traffic Manager, put the "TrafficManager" class instance in the world and specify the following parameters:

  • Simulation Radius - the radius, within which simulation will be performed.
  • Freeze Radius - the radius, within which objects will be set.
  • Cars Density - the density of cars.
  • Pedestrians Density - the density of pedestrians.

To specify areas on which objects will appear, you need to assign a "SpawnObject" entity to these objects. This objects can be either ObjectMesh, or NodeReference with ObjectMesh as a root node. In this case, a SpawnObject entity will find a spawn_surface surface, and define triangles to put objects onto (objects will be placed only on surfaces with the specified slope angle).

Depending on the density, Traffic Manager will automatically place objects within this area. If you need to specify a particular amount of objects for this SpawnObject, just set the necessary amount to "Cars Count" and "Pedestrians Count" parameters.

Last update: 2017-10-20
Build: ()