A* Pathfinding Project
4.1.9
The A* Pathfinding Project for Unity 3D
|
Adds a navmesh as RVO obstacles. More...
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).
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.
Public Member Functions | |
override void | OnGraphsPostUpdate () |
Called after graphs have been updated using GraphUpdateObjects. More... | |
override void | OnLatePostScan () |
Called at the end of the scanning procedure. More... | |
override void | OnPostCacheLoad () |
Called after cached graphs have been loaded. More... | |
void | RemoveObstacles () |
Removes all obstacles which have been added by this component. More... | |
Public Member Functions inherited from GraphModifier | |
virtual void | OnGraphsPreUpdate () |
Called before graphs are updated using GraphUpdateObjects. More... | |
virtual void | OnPostScan () |
Called right after all graphs have been scanned. More... | |
virtual void | OnPreScan () |
Called right before graphs are going to be scanned. More... | |
Public Attributes | |
float | wallHeight = 5 |
Height of the walls added for each obstacle edge. More... | |
Protected Member Functions | |
override void | OnDisable () |
Removes this modifier from list of active modifiers. More... | |
Protected Member Functions inherited from GraphModifier | |
override void | Awake () |
virtual void | OnDestroy () |
virtual void | OnEnable () |
Adds this modifier to list of active modifiers. More... | |
Protected Member Functions inherited from VersionedMonoBehaviour | |
virtual int | OnUpgradeSerializedData (int version, bool unityThread) |
Handle serialization backwards compatibility. More... | |
Private Member Functions | |
void | AddGraphObstacles (Pathfinding.RVO.Simulator sim, GridGraph grid) |
Adds obstacles for a grid graph. More... | |
void | AddGraphObstacles (Pathfinding.RVO.Simulator simulator, INavmesh navmesh) |
Adds obstacles for a navmesh/recast graph. More... | |
Private Attributes | |
Simulator | lastSim |
Last simulator used. More... | |
readonly List< ObstacleVertex > | obstacles = new List<ObstacleVertex>() |
Obstacles currently added to the simulator. More... | |
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. More... | |
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. More... | |
Static Protected Attributes inherited from GraphModifier | |
static Dictionary< ulong, GraphModifier > | usedIDs = new Dictionary<ulong, GraphModifier>() |
Maps persistent IDs to the component that uses it. More... | |
|
private |
Adds obstacles for a grid graph.
|
private |
Adds obstacles for a navmesh/recast graph.
|
protectedvirtual |
Removes this modifier from list of active modifiers.
Reimplemented from GraphModifier.
|
virtual |
Called after graphs have been updated using GraphUpdateObjects.
Eventual flood filling has been done
Reimplemented from GraphModifier.
|
virtual |
Called at the end of the scanning procedure.
This is the absolute last thing done by Scan.
Reimplemented from GraphModifier.
|
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.
|
private |
Last simulator used.
|
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.