A* Pathfinding Project  3.1.4
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Enumerations Properties Groups Pages
GraphUpdateObject Class Reference

Represents a collection of settings used to update nodes in a specific area of a graph. More...

+ Inheritance diagram for GraphUpdateObject:
+ Collaboration diagram for GraphUpdateObject:

Public Member Functions

 GraphUpdateObject (Bounds b)
 Creates a new GUO with the specified bounds.
 
virtual void Apply (Node node)
 Updates the specified node using this GUO's settings.
 
virtual void RevertFromBackup ()
 Reverts penalties and flags (which includes walkability) on every node which was updated using this GUO.
 
virtual void WillUpdateNode (Node node)
 Should be called on every node which is updated with this GUO before it is updated.
 

Public Attributes

int addPenalty = 0
 Penalty to add to the nodes.
 
Bounds bounds
 The bounds to update nodes within.
 
bool modifyTag = false
 
bool modifyWalkability = false
 If true, all nodes walkable variables will be set to setWalkability.
 
NNConstraint nnConstraint = NNConstraint.None
 NNConstraint to use.
 
bool requiresFloodFill = true
 Performance boost.
 
int setTag = 0
 
bool setWalkability = false
 If modifyWalkability is true, the nodes' walkable variable will be set to this.
 
GraphUpdateShape shape = null
 
bool trackChangedNodes = false
 Track which nodes are changed and save backup data.
 
bool updatePhysics = true
 Use physics checks to update nodes.
 

Private Attributes

List< ulong > backupData
 
List< Int3backupPositionData
 
List< NodechangedNodes
 

Detailed Description

Represents a collection of settings used to update nodes in a specific area of a graph.

See Also
AstarPath::UpdateGraphs

Member Function Documentation

virtual void RevertFromBackup ( )
virtual

Reverts penalties and flags (which includes walkability) on every node which was updated using this GUO.

Data for reversion is only saved if trackChangedNodes is true

+ Here is the caller graph for this function:

virtual void WillUpdateNode ( Node  node)
virtual

Should be called on every node which is updated with this GUO before it is updated.

Parameters
nodeThe node to save fields for. If null, nothing will be done
See Also
trackChangedNodes

+ Here is the caller graph for this function:

Member Data Documentation

NNConstraint to use.

The Pathfinding::NNConstraint::SuitableGraph function will be called on the NNConstraint to enable filtering of which graphs to update.

Note
As the Pathfinding::NNConstraint::SuitableGraph function is A* Pathfinding Project Pro only, this variable doesn't really affect anything in the free version.
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
bool requiresFloodFill = true

Performance boost.

This controlls if a flood fill will be carried out after this GUO has been applied.
If you are sure that a GUO will not modify walkability or connections. You can set this to false. For example when only updating penalty values it can save processing power when setting this to false. Especially on large graphs.

Note
If you set this to false, even though it does change e.g walkability, it can lead to paths returning that they failed even though there is a path, or the try to search the whole graph for a path even though there is none, and will in the processes use wast amounts of processing power.

If using the basic GraphUpdateObject (not a derived class), a quick way to check if it is going to need a flood fill is to check if modifyWalkability is true or updatePhysics is true.

bool trackChangedNodes = false

Track which nodes are changed and save backup data.

Used internally to revert changes if needed.

bool updatePhysics = true

Use physics checks to update nodes.

When updating a grid graph and this is true, the nodes' position and walkability will be updated using physics checks with settings from "Collision Testing" and "Height Testing". Also when updating a PointGraph, setting this to true will make it re-evaluate all connections in the graph which passes through the bounds. This has no effect when updating GridGraphs if modifyWalkability is turned on


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