A* Pathfinding Project  4.1.4
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
Connection Struct Reference

Represents a connection to another node. More...

Detailed Description

Represents a connection to another node.

Public Member Functions

 Connection (GraphNode node, uint cost, byte shapeEdge=0xFF)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Public Attributes

uint cost
 Cost of moving along this connection.
 
GraphNode node
 Node which this connection goes to.
 
byte shapeEdge
 Side of the node shape which this connection uses.
 

Constructor & Destructor Documentation

Connection ( GraphNode  node,
uint  cost,
byte  shapeEdge = 0xFF 
)

Member Function Documentation

override bool Equals ( object  obj)
override int GetHashCode ( )

Member Data Documentation

uint cost

Cost of moving along this connection.

A cost of 1000 corresponds approximately to the cost of moving one world unit.

GraphNode node

Node which this connection goes to.

byte shapeEdge

Side of the node shape which this connection uses.

Used for mesh nodes. A value of 0 corresponds to using the side for vertex 0 and vertex 1 on the node. 1 corresponds to vertex 1 and 2, etc. A negative value means that this connection does not use any side at all (this is mostly used for off-mesh links).

Note
Due to alignment, the node and cost fields use 12 bytes which will be padded to 16 bytes when used in an array even if this field would be removed. So this field does not contribute to increased memory usage.
See Also
TriangleMeshNode
TriangleMeshNode.AddConnection

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