A* Pathfinding Project  4.1.19
The A* Pathfinding Project for Unity 3D
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. More...
 
GraphNode node
 Node which this connection goes to. More...
 
byte shapeEdge
 Side of the node shape which this connection uses. More...
 

Constructor & Destructor Documentation

◆ Connection()

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

Member Function Documentation

◆ Equals()

override bool Equals ( object  obj)

◆ GetHashCode()

override int GetHashCode ( )

Member Data Documentation

◆ cost

uint cost

Cost of moving along this connection.

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

◆ node

GraphNode node

Node which this connection goes to.

◆ shapeEdge

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: