Rebornbuddy
Loading...
Searching...
No Matches
Pathfinding.Node Class Reference

Basically a node is defined with a geographical position in space. It is also characterized with both collections of outgoing arcs and incoming arcs. More...

Public Member Functions

 Node ()
 Node (float PositionX, float PositionY, float PositionZ)
 Constructor.
 Node (float PositionX, float PositionY, float PositionZ, int id, int[] dontconnect)
 Node (Vector3 location, int id, int[] dontconnect)
 Node (Vector3 location, int id, List< int > neighbors)
void ChangeXYZ (float PositionX, float PositionY, float PositionZ)
 Modifies X, Y and Z coordinates.
override string ToString ()
 object.ToString() override. Returns the textual description of the node.
override bool Equals (object O)
 Object.Equals override. Tells if two nodes are equal by comparing positions.
object Clone ()
 Returns a copy of this node.
override int GetHashCode ()
 Object.GetHashCode override.

Static Public Member Functions

static double EuclidianDistance (Node N1, Node N2)
 Returns the euclidian distance between two nodes : Sqrt(Dx�+Dy�+Dz�)
static double Euclidian2DDistance (Node N1, Node N2)
static double SquareEuclidianDistance (Node N1, Node N2)
 Returns the square euclidian distance between two nodes : Dx�+Dy�+Dz�
static double SquareEuclidian2DDistance (Node N1, Node N2)
static double ManhattanDistance (Node N1, Node N2)
 Returns the manhattan distance between two nodes : |Dx|+|Dy|+|Dz|.
static double MaxDistanceAlongAxis (Node N1, Node N2)
 Returns the maximum distance between two nodes : Max(|Dx|, |Dy|, |Dz|)

Public Attributes

int Id
List< int > DontConnect
List< int > AlreadyVisited = new List<int>()
List< int > Neighbors

Properties

bool DontConnectSpecified [get]
bool NeighborsSpecified [get]
bool Passable [get, set]
 Gets the list of the arcs that lead to this node.
float X [get, set]
 Gets X coordinate.
float Y [get, set]
 Gets Y coordinate.
float Z [get, set]
 Gets Z coordinate.
Vector3 Position [get, set]
 Gets/Sets the geographical position of the node.

Detailed Description

Basically a node is defined with a geographical position in space. It is also characterized with both collections of outgoing arcs and incoming arcs.

Constructor & Destructor Documentation

◆ Node() [1/5]

Pathfinding.Node.Node ( )

◆ Node() [2/5]

Pathfinding.Node.Node ( float PositionX,
float PositionY,
float PositionZ )

Constructor.

Parameters
PositionXX coordinate.
PositionYY coordinate.
PositionZZ coordinate.

◆ Node() [3/5]

Pathfinding.Node.Node ( float PositionX,
float PositionY,
float PositionZ,
int id,
int[] dontconnect )

◆ Node() [4/5]

Pathfinding.Node.Node ( Vector3 location,
int id,
int[] dontconnect )

◆ Node() [5/5]

Pathfinding.Node.Node ( Vector3 location,
int id,
List< int > neighbors )

Member Function Documentation

◆ ChangeXYZ()

void Pathfinding.Node.ChangeXYZ ( float PositionX,
float PositionY,
float PositionZ )

Modifies X, Y and Z coordinates.

Parameters
PositionXX coordinate.
PositionYY coordinate.
PositionZZ coordinate.

◆ Clone()

object Pathfinding.Node.Clone ( )

Returns a copy of this node.

Returns
The reference of the new object.

◆ Equals()

override bool Pathfinding.Node.Equals ( object O)

Object.Equals override. Tells if two nodes are equal by comparing positions.

Exceptions
ArgumentExceptionA Node cannot be compared with another type.
Parameters
OThe node to compare with.
Returns
'true' if both nodes are equal.

◆ Euclidian2DDistance()

double Pathfinding.Node.Euclidian2DDistance ( Node N1,
Node N2 )
static

◆ EuclidianDistance()

double Pathfinding.Node.EuclidianDistance ( Node N1,
Node N2 )
static

Returns the euclidian distance between two nodes : Sqrt(Dx�+Dy�+Dz�)

Parameters
N1First node.
N2Second node.
Returns
Distance value.

◆ GetHashCode()

override int Pathfinding.Node.GetHashCode ( )

Object.GetHashCode override.

Returns
HashCode value.

◆ ManhattanDistance()

double Pathfinding.Node.ManhattanDistance ( Node N1,
Node N2 )
static

Returns the manhattan distance between two nodes : |Dx|+|Dy|+|Dz|.

Exceptions
ArgumentNullExceptionArgument nodes must not be null.
Parameters
N1First node.
N2Second node.
Returns
Distance value.

◆ MaxDistanceAlongAxis()

double Pathfinding.Node.MaxDistanceAlongAxis ( Node N1,
Node N2 )
static

Returns the maximum distance between two nodes : Max(|Dx|, |Dy|, |Dz|)

Exceptions
ArgumentNullExceptionArgument nodes must not be null.
Parameters
N1First node.
N2Second node.
Returns
Distance value.

◆ SquareEuclidian2DDistance()

double Pathfinding.Node.SquareEuclidian2DDistance ( Node N1,
Node N2 )
static

◆ SquareEuclidianDistance()

double Pathfinding.Node.SquareEuclidianDistance ( Node N1,
Node N2 )
static

Returns the square euclidian distance between two nodes : Dx�+Dy�+Dz�

Exceptions
ArgumentNullExceptionArgument nodes must not be null.
Parameters
N1First node.
N2Second node.
Returns
Distance value.

◆ ToString()

override string Pathfinding.Node.ToString ( )

object.ToString() override. Returns the textual description of the node.

Returns
String describing this node.

Member Data Documentation

◆ AlreadyVisited

List<int> Pathfinding.Node.AlreadyVisited = new List<int>()

◆ DontConnect

List<int> Pathfinding.Node.DontConnect

◆ Id

int Pathfinding.Node.Id

◆ Neighbors

List<int> Pathfinding.Node.Neighbors

Property Documentation

◆ DontConnectSpecified

bool Pathfinding.Node.DontConnectSpecified
get

◆ NeighborsSpecified

bool Pathfinding.Node.NeighborsSpecified
get

◆ Passable

bool Pathfinding.Node.Passable
getset

Gets the list of the arcs that lead to this node.

Gets the list of the arcs that start from this node. Gets/Sets the functional state of the node. 'true' means that the node is in its normal state. 'false' means that the node will not be taken into account (as if it did not exist).

◆ Position

Vector3 Pathfinding.Node.Position
getset

Gets/Sets the geographical position of the node.

Exceptions
ArgumentNullExceptionCannot set the Position to null.

◆ X

float Pathfinding.Node.X
getset

Gets X coordinate.

◆ Y

float Pathfinding.Node.Y
getset

Gets Y coordinate.

◆ Z

float Pathfinding.Node.Z
getset

Gets Z coordinate.