A* Pathfinding Project  3.8
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
PathNode Class Reference

Stores temporary node data for a single pathfinding request. More...

Detailed Description

Stores temporary node data for a single pathfinding request.

Every node has one PathNode per thread used. It stores e.g G score, H score and other temporary variables needed for path calculation, but which are not part of the graph structure.

See Also
Pathfinding.PathHandler
https://en.wikipedia.org/wiki/A*_search_algorithm

Public Attributes

GraphNode node
 Reference to the actual graph node.
 
PathNode parent
 Parent node in the search tree.
 
ushort pathID
 The path request (in this thread, if multithreading is used) which last used this node.
 

Properties

uint cost [get, set]
 
uint F [get]
 F score.
 
bool flag1 [get, set]
 Use as temporary flag during pathfinding.
 
bool flag2 [get, set]
 Use as temporary flag during pathfinding.
 
uint G [get, set]
 G score, cost to get to this node.
 
uint H [get, set]
 H score, estimated cost to get to to the target.
 

Private Attributes

const uint CostMask = (1U << 28) - 1U
 Cost uses the first 28 bits.
 
const uint Flag1Mask = (uint)(1 << Flag1Offset)
 
const int Flag1Offset = 28
 Flag 1 is at bit 28.
 
const uint Flag2Mask = (uint)(1 << Flag2Offset)
 
const int Flag2Offset = 29
 Flag 2 is at bit 29.
 
uint flags
 Bitpacked variable which stores several fields.
 
uint g
 Backing field for the G score.
 
uint h
 Backing field for the H score.
 

Member Data Documentation

const uint CostMask = (1U << 28) - 1U
private

Cost uses the first 28 bits.

const uint Flag1Mask = (uint)(1 << Flag1Offset)
private
const int Flag1Offset = 28
private

Flag 1 is at bit 28.

const uint Flag2Mask = (uint)(1 << Flag2Offset)
private
const int Flag2Offset = 29
private

Flag 2 is at bit 29.

uint flags
private

Bitpacked variable which stores several fields.

uint g
private

Backing field for the G score.

uint h
private

Backing field for the H score.

GraphNode node

Reference to the actual graph node.

PathNode parent

Parent node in the search tree.

ushort pathID

The path request (in this thread, if multithreading is used) which last used this node.

Property Documentation

uint cost
getset
uint F
get

F score.

H score + G score

bool flag1
getset

Use as temporary flag during pathfinding.

Pathfinders (only) can use this during pathfinding to mark nodes. When done, this flag should be reverted to its default state (false) to avoid messing up other pathfinding requests.

bool flag2
getset

Use as temporary flag during pathfinding.

Pathfinders (only) can use this during pathfinding to mark nodes. When done, this flag should be reverted to its default state (false) to avoid messing up other pathfinding requests.

uint G
getset

G score, cost to get to this node.

uint H
getset

H score, estimated cost to get to to the target.


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