Class SimulatorBurst Extends ISimulator

Public

Local Avoidance Simulator.

This class handles local avoidance simulation for a number of agents using Reciprocal Velocity Obstacles (RVO) and Optimal Reciprocal Collision Avoidance (ORCA).

This class will handle calculation of velocities from desired velocities supplied by a script. It is, however, not responsible for moving any objects in a Unity Scene. For that there are other scripts (see below).

Obstacles can be added and removed from the simulation, agents can also be added and removed at any time.

The implementation uses a sampling based algorithm with gradient descent to find the avoidance velocities.

You will most likely mostly use the wrapper class RVOSimulator.

A* Pro Feature:

This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited.
The Pro version can be bought here

Inner Types

Public Methods

AddAgent (agent)
Public
AddAgent (position, elevationCoordinate)

Add an agent at the specified position.

Public
AddObstacle (v)
Public
AddObstacle (vertices, height, cycle=true)
Public
AddObstacle (a, b, height)
Public
AddObstacle (vertices, height, matrix, layer=…, cycle=true)
Public
ClearAgents ()

Removes all agents from the simulation.

Public
GetAgents ()

Get a list of all agents.

Public
GetObstacles ()

Get a list of all obstacles.

Public
OnDestroy ()

Frees all used memory.

Public
RemoveAgent (agent)

Removes a specified agent from this simulation.

Public
RemoveObstacle (v)
Public
SimulatorBurst (doubleBuffering, movementPlane)

Create a new simulator.

Public
Update ()

Should be called once per frame.

Public
UpdateObstacle (obstacle, vertices, matrix)
Public
UpdateObstacles ()

Rebuilds the obstacle tree at next simulation frame.

Public

Public Variables

AgentBounds
Public
AgentCount

Number of agents in the simulation.

Public
AnyAgentHasDebug

True if at least one agent had debug drawing enabled during the previous frame.

Public
DeltaTime
Public
DesiredDeltaTime

Time in seconds between each simulation step.

Public
DoubleBuffering

Use double buffering.

Public
HardCollisions

Use hard collisions.

Public
MovementPlane
Public
movementPlane

Determines if the XY (2D) or XZ (3D) plane is used for movement.

Public Readonly
Multithreading
Public
obstacles

Obstacles in this simulation.

Public
outputData

Internal simulation data.

Public
quadtree

Quadtree for this simulation.

Public
simulationData

Internal simulation data.

Public
SymmetryBreakingBias

Bias agents to pass each other on the right side.

Public

Private/Protected Members

agentPreCalculationCallbacks
Private
agents

Agents in this simulation.

Private
AllocateAgentSpace ()
Private
BlockUntilSimulationStepIsDone ()

Blocks until separate threads have finished with the current simulation step.

Private
CleanAndUpdateObstaclesIfNecessary ()
Private
CleanObstacles ()
Private
currentSimulationData

A copy of the the simulationData used when the calculations are running.

Private
deltaTime
Private
desiredDeltaTime

Inverse desired simulation fps.

Private
horizonAgentData
Private
inProgressJob
Private
inProgressOutputData
Private
jobInProgress
Private
lastStep
Private
numAgents

Number of agents in this simulation.

Private
PreCalculation ()
Private
ScheduleCleanObstacles ()
Private
temporaryAgentData
Private