A* Pathfinding Project
3.1.4
The A* Pathfinding Project for Unity 3D
|
Represents a collection of settings used to update nodes in a specific area of a graph. More...
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< Int3 > | backupPositionData |
List< Node > | changedNodes |
Represents a collection of settings used to update nodes in a specific area of a graph.
|
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
|
virtual |
Should be called on every node which is updated with this GUO before it is updated.
node | The node to save fields for. If null, nothing will be done |
NNConstraint nnConstraint = NNConstraint.None |
NNConstraint to use.
The Pathfinding::NNConstraint::SuitableGraph function will be called on the NNConstraint to enable filtering of which graphs to update.
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.
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