A* Pathfinding Project  4.1.3
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
RVONavmesh Class Reference

Adds a navmesh as RVO obstacles. More...

Detailed Description

Adds a navmesh as RVO obstacles.

Add this to a scene in which has a navmesh or grid based graph, when scanning (or loading from cache) the graph it will be added as RVO obstacles to the RVOSimulator (which must exist in the scene).

Warning
You should only have a single instance of this script in the scene, otherwise it will add duplicate obstacles and thereby increasing the CPU usage.

If you update a graph during runtime the obstacles need to be recalculated which has a performance penalty. This can be quite significant for larger graphs.

In the screenshot the generated obstacles are visible in red.

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

Public Member Functions

override void OnGraphsPostUpdate ()
 Called after graphs have been updated using GraphUpdateObjects.
 
override void OnLatePostScan ()
 Called at the end of the scanning procedure.
 
override void OnPostCacheLoad ()
 Called after cached graphs have been loaded.
 
void RemoveObstacles ()
 Removes all obstacles which have been added by this component.
 
- Public Member Functions inherited from GraphModifier
virtual void OnGraphsPreUpdate ()
 Called before graphs are updated using GraphUpdateObjects.
 
virtual void OnPostScan ()
 Called right after all graphs have been scanned.
 
virtual void OnPreScan ()
 Called right before graphs are going to be scanned.
 

Public Attributes

float wallHeight = 5
 Height of the walls added for each obstacle edge.
 

Protected Member Functions

override void OnDisable ()
 Removes this modifier from list of active modifiers.
 
- Protected Member Functions inherited from GraphModifier
override void Awake ()
 
virtual void OnDestroy ()
 
virtual void OnEnable ()
 Adds this modifier to list of active modifiers.
 
- Protected Member Functions inherited from VersionedMonoBehaviour
virtual int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility.
 

Private Member Functions

void AddGraphObstacles (Pathfinding.RVO.Simulator sim, GridGraph grid)
 Adds obstacles for a grid graph.
 
void AddGraphObstacles (Pathfinding.RVO.Simulator simulator, INavmesh navmesh)
 Adds obstacles for a navmesh/recast graph.
 

Private Attributes

Simulator lastSim
 Last simulator used.
 
readonly List< ObstacleVertexobstacles = new List<ObstacleVertex>()
 Obstacles currently added to the simulator.
 

Additional Inherited Members

- Public Types inherited from GraphModifier
enum  EventType {
  PostScan = 1 << 0, PreScan = 1 << 1, LatePostScan = 1 << 2, PreUpdate = 1 << 3,
  PostUpdate = 1 << 4, PostCacheLoad = 1 << 5
}
 GraphModifier event type. More...
 
- Static Public Member Functions inherited from GraphModifier
static void FindAllModifiers ()
 
static void TriggerEvent (GraphModifier.EventType type)
 Triggers an event for all active graph modifiers.
 
- Static Protected Member Functions inherited from GraphModifier
static List< T > GetModifiersOfType< T > ()
 
- Protected Attributes inherited from GraphModifier
ulong uniqueID
 Unique persistent ID for this component, used for serialization.
 
- Static Protected Attributes inherited from GraphModifier
static Dictionary< ulong,
GraphModifier
usedIDs = new Dictionary<ulong, GraphModifier>()
 Maps persistent IDs to the component that uses it.
 

Member Function Documentation

void AddGraphObstacles ( Pathfinding.RVO.Simulator  sim,
GridGraph  grid 
)
private

Adds obstacles for a grid graph.

void AddGraphObstacles ( Pathfinding.RVO.Simulator  simulator,
INavmesh  navmesh 
)
private

Adds obstacles for a navmesh/recast graph.

override void OnDisable ( )
protectedvirtual

Removes this modifier from list of active modifiers.

Reimplemented from GraphModifier.

override void OnGraphsPostUpdate ( )
virtual

Called after graphs have been updated using GraphUpdateObjects.

Eventual flood filling has been done

Reimplemented from GraphModifier.

override void OnLatePostScan ( )
virtual

Called at the end of the scanning procedure.

This is the absolute last thing done by Scan.

Reimplemented from GraphModifier.

override void OnPostCacheLoad ( )
virtual

Called after cached graphs have been loaded.

When using cached startup, this event is analogous to OnLatePostScan and implementing scripts should do roughly the same thing for both events.

Reimplemented from GraphModifier.

void RemoveObstacles ( )

Removes all obstacles which have been added by this component.

Member Data Documentation

Simulator lastSim
private

Last simulator used.

readonly List<ObstacleVertex> obstacles = new List<ObstacleVertex>()
private

Obstacles currently added to the simulator.

float wallHeight = 5

Height of the walls added for each obstacle edge.

If a graph contains overlapping regions (e.g multiple floor in a building) you should set this low enough so that edges on different levels do not interfere, but high enough so that agents cannot move over them by mistake.


The documentation for this class was generated from the following file: