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

Describes a single node for the LayeredGridGraph. More...

+ Inheritance diagram for LevelGridNode:
+ Collaboration diagram for LevelGridNode:

Public Member Functions

override void FloodFill (Stack< Node > stack, int area)
 Adds all connecting nodes to the stack and sets the area variable to area.
 
bool GetConnection (int i)
 Is there a grid connection in that direction.
 
int GetConnectionValue (int dir)
 Which layer a grid connection goes to.
 
int GetGridIndex ()
 
int GetIndex ()
 
bool HasAnyGridConnections ()
 Does this node have any grid connections.
 
override new void Open (NodeRunData nodeRunData, NodeRun nodeR, Int3 targetPosition, Path path)
 
void ResetAllGridConnections ()
 Removes all grid connections from this node.
 
void SetConnectionValue (int dir, int value)
 Set which layer a grid connection goes to.
 
void SetGridIndex (int gridIndex)
 
void SetIndex (int i)
 
override new void UpdateAllG (NodeRun nodeR, NodeRunData nodeRunData)
 
- Public Member Functions inherited from Node
void AddConnection (Node node, int cost)
 Add a connection to the node with the specified cost.
 
void BaseFloodFill (Stack< Node > stack, int area)
 Adds all connecting nodes to the stack and sets the area variable to area.
 
int[] BaseInitialOpen (BinaryHeapM open, Int3 targetPosition, Int3 position, Path path, bool doOpen)
 
void BaseOpen (NodeRunData nodeRunData, NodeRun nodeR, Int3 targetPosition, Path path)
 Opens the nodes connected to this node.
 
void BaseResetCosts (int[] costs)
 Resets the costs modified by the InitialOpen function when 'doOpen' was false (for the end node).
 
virtual bool ContainsConnection (Node node)
 Returns true if this node has a connection to the node.
 
virtual void GetConnections (NodeDelegate callback)
 Get all connections for a node.
 
void GetConnectionsBase (NodeDelegate callback)
 Get all connections for a node.
 
int GetNodeIndex ()
 Returns the global node index.
 
virtual int[] InitialOpen (BinaryHeapM open, Int3 targetPosition, Int3 position, Path path, bool doOpen)
 
void RecalculateConnectionCosts (bool neighbours)
 Recalculate costs for each connection.
 
virtual bool RemoveConnection (Node node)
 Removes the connection to the node if it exists.
 
virtual void ResetCosts (int[] costs)
 Resets the costs modified by the InitialOpen function when 'doOpen' was false (for the end node).
 
void SetNodeIndex (int index)
 
virtual void UpdateConnections ()
 Remove connections to unwalkable nodes.
 
void UpdateG (NodeRun nodeR, NodeRunData nodeRunData)
 
void UpdateH (Int3 targetPosition, Heuristic heuristic, float scale, NodeRun nodeR)
 Calculates and updates the H score.
 
virtual void UpdateNeighbourConnections ()
 Calls UpdateConnections on all neighbours.
 

Static Public Member Functions

static void RemoveGridGraph (LayerGridGraph graph)
 
static int SetGridGraph (LayerGridGraph graph)
 
- Static Public Member Functions inherited from Node
static int Abs (int x)
 Implementation of the Absolute function.
 

Public Attributes

float height
 
const int MaxLayerCount = ConnectionMask
 
const int NoConnection = 0xF
 
- Public Attributes inherited from Node
int[] connectionCosts
 Cost for the connections to other nodes.
 
Node[] connections
 List of all connections from this node.
 
int flags
 Bit packed values for different fields.
 
Int3 position
 Position in world space of the node.
 

Protected Attributes

ushort gridConnections
 
uint gridConnections
 
int indices
 First 24 bits used for the index value of this node in the graph specified by the last 8 bits.
 

Static Protected Attributes

static LayerGridGraph[] gridGraphs
 

Private Attributes

const int ConnectionMask = 0xF
 
const int ConnectionStride = 4
 

Additional Inherited Members

- Protected Member Functions inherited from Node
void BaseUpdateAllG (NodeRun nodeR, NodeRunData nodeRunData)
 
- Properties inherited from Node
int area [get, set]
 Area ID of the node.
 
bool Bit15 [get, set]
 Returns bit 15 from flags.
 
bool Bit16 [get, set]
 Returns bit 16 from flags.
 
bool Bit8 [get, set]
 Returns bit 8 from flags.
 
int graphIndex [get, set]
 The index of the graph this node is in.
 
uint penalty [get, set]
 
int tags [get, set]
 Tags for walkability.
 
bool walkable [get, set]
 Is the node walkable.
 

Detailed Description

Describes a single node for the LayeredGridGraph.

Works almost the same as a grid node, except that it also stores to which layer the connections go to

Member Function Documentation

int GetConnectionValue ( int  dir)

Which layer a grid connection goes to.

Parameters
dirDirection for the connection.
Returns
The layer of the connected node or #NoConnection if there is no connection in that direction.

+ Here is the caller graph for this function:

void SetConnectionValue ( int  dir,
int  value 
)

Set which layer a grid connection goes to.

Parameters
dirDirection for the connection.
valueThe layer of the connected node or #NoConnection if there should be no connection in that direction.

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