Handles calculating the avoidance velocities for all IAvoidanceAgents.
More...
|
virtual void | OnEnable () |
| Schedule coroutine when the manager is enabled. More...
|
|
void | OnDisable () |
| Dispose data structures when disabled. Coroutine will stop automatically. More...
|
|
Handles calculating the avoidance velocities for all IAvoidanceAgents.
There should only be one AvoidanceManager active at a time, as it will handle all agents together. This is done using the C# Job System and Burst compiler to calculate avoidance very quickly. If it is still not fast enough, try changing the TimeHorizon and/or MaxObstaclesConsidered values.
◆ OnDisable()
void Infohazard.HyperNav.AvoidanceManager.OnDisable |
( |
| ) |
|
|
protected |
Dispose data structures when disabled. Coroutine will stop automatically.
◆ OnEnable()
virtual void Infohazard.HyperNav.AvoidanceManager.OnEnable |
( |
| ) |
|
|
protectedvirtual |
Schedule coroutine when the manager is enabled.
◆ UpdateAvoidance()
virtual void Infohazard.HyperNav.AvoidanceManager.UpdateAvoidance |
( |
float |
deltaTime | ) |
|
|
virtual |
Update the avoidance of all agents. Can be called manually if UpdateMode is set to manual.
- Parameters
-
deltaTime | Time delta since last call. |
◆ _dataGrowRatio
float Infohazard.HyperNav.AvoidanceManager._dataGrowRatio = 1.2f |
|
private |
(Serialized) How much to grow data structures by when they are not large enough.
Higher values reduce the number of allocations if agent count is steadily growing, but may also lead to wasted memory.
◆ _maxObstaclesConsidered
int Infohazard.HyperNav.AvoidanceManager._maxObstaclesConsidered = 10 |
|
private |
(Serialized) The maximum number of obstacles that can be considered by each agent for avoidance.
This value caps the number of avoidance calculations per agent. Generally it should be equal to the max number of obstacles you expect to be within TimeHorizon * IAvoidanceObstacle.MaxSpeed of an agent.
◆ _timeHorizon
float Infohazard.HyperNav.AvoidanceManager._timeHorizon = 5 |
|
private |
(Serialized) How far in the future to look when avoiding collisions.
A lower value reduces the number of calculations per agent, with the drawback of being able to plan less far ahead.
◆ _updateMode
(Serialized) When to update the avoidance velocities of agents.
◆ _useJob
bool Infohazard.HyperNav.AvoidanceManager._useJob = true |
|
private |
(Serialized) Whether to use the C# Job System/Burst Compiler or to just run updates on the main thread.
◆ DataGrowRatio
float Infohazard.HyperNav.AvoidanceManager.DataGrowRatio |
|
getset |
How much to grow data structures by when they are not large enough.
Higher values reduce the number of allocations if agent count is steadily growing, but may also lead to wasted memory.
◆ MaxObstaclesConsidered
int Infohazard.HyperNav.AvoidanceManager.MaxObstaclesConsidered |
|
getset |
The maximum number of obstacles that can be considered by each agent for avoidance.
This value caps the number of avoidance calculations per agent. Generally it should be equal to the max number of obstacles you expect to be within TimeHorizon * IAvoidanceObstacle.MaxSpeed of an agent.
◆ TimeHorizon
float Infohazard.HyperNav.AvoidanceManager.TimeHorizon |
|
getset |
How far in the future to look when avoiding collisions.
A lower value reduces the number of calculations per agent, with the drawback of being able to plan less far ahead.
◆ UpdateMode
When to update the avoidance velocities of agents.
◆ UseJob
bool Infohazard.HyperNav.AvoidanceManager.UseJob |
|
getset |
Whether to use the C# Job System/Burst Compiler or to just run updates on the main thread.
The documentation for this class was generated from the following file:
- Runtime/Avoidance/AvoidanceManager.cs