A* Pathfinding Project  3.0.9
The A* Pathfinding Project for Unity
GraphUpdateObject Class Reference

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

+ Collaboration diagram for GraphUpdateObject:

List of all members.

Public Member Functions

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

Public Variables

Bounds bounds  The bounds to update nodes within.
bool requiresFloodFill = true  Performance boost.
bool updatePhysics = true  Use physics checks to update nodes.
NNConstraint nnConstraint = NNConstraint.None  NNConstraint to use.
int addPenalty = 0  Penalty to add to the nodes.
bool modifyWalkability = false  If true, all nodes walkable variables will be set to setWalkability.
bool setWalkability = false  If modifyWalkability is true, the nodes' walkable variable will be set to this.
int tagsChange = 0  Which tags to change.
int tagsValue = 0  The values to which the tags will be changed.
bool trackChangedNodes = false  
List< NodechangedNodes  
List< ulong > backupData  

Detailed Description

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

See also:
AstarPath::UpdateGraphs

Constructor & Destructor Documentation

GraphUpdateObject ( Bounds  b)

Creates a new GUO with the specified bounds.


Member Function Documentation

virtual void Apply ( Node  node) [virtual]

Updates the specified node using this GUO's settings.

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

virtual void WillUpdateNode ( Node  node) [virtual]

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


Member Data Documentation

int addPenalty = 0

Penalty to add to the nodes.

Bounds bounds

The bounds to update nodes within.

bool modifyWalkability = false

If true, all nodes walkable variables will be set to setWalkability.

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 setWalkability = false

If modifyWalkability is true, the nodes' walkable variable will be set to this.

int tagsChange = 0

Which tags to change.

int tagsValue = 0

The values to which the tags will be changed.

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 ListGraph, 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:
 All Classes Functions Variables Enumerations Properties