Rebornbuddy
|
Graph structure. It is defined with : It is defined with both a list of nodes and a list of arcs. More...
Public Member Functions | |
Node | NodeById (int id) |
IEnumerable< Node > | Search (Vector3 loc, float maxRange) |
IEnumerable< Node > | Search (Node loc, float maxRange) |
Graph () | |
Constructor. | |
void | Clear () |
Empties the graph. | |
bool | AddNode (Node NewNode) |
Directly Adds a node to the graph. | |
Node | AddNode (float x, float y, float z) |
Creates a node, adds to the graph and returns its reference. | |
Node | AddNode (float x, float y, float z, int id, int[] ignore) |
Creates a node, adds to the graph and returns its reference. | |
Node | AddNode (Vector3 xyz, int id, int[] ignore) |
Creates a node, adds to the graph and returns its reference. | |
List< int > | FreeIds (int wanted) |
bool | AddArc (Arc NewArc) |
Directly Adds an arc to the graph. | |
Arc | AddArc (Node StartNode, Node EndNode, float Weight) |
Creates an arc between two nodes that are already registered in the graph, adds it to the graph and returns its reference. | |
void | Add2Arcs (Node Node1, Node Node2, float Weight) |
Adds the two opposite arcs between both specified nodes to the graph. | |
Node | FindClosest (Vector3 loc, Predicate< Node > predicate=null) |
bool | RemoveNode (Node NodeToRemove) |
Removes a node from the graph as well as the linked arcs. | |
void | RemoveAllArcs () |
bool | RemoveArc (Arc ArcToRemove) |
Removes a node from the graph as well as the linked arcs. | |
Node | ClosestNode (float PtX, float PtY, float PtZ, out float Distance, bool IgnorePassableProperty) |
This function will find the closest node from a geographical position in space. | |
Node | CloestNode (Vector3 point) |
Node | ClosestNode (Vector3 point, out float Distance, bool IgnorePassableProperty) |
Node | ClosestNode2D (Vector3 point) |
Arc | ClosestArc2D (Vector3 point, out float distance) |
List< CloseNode > | ClosestNodes (Vector3 point, int desiredNodes, bool IgnorePassableProperty) |
returns the three closest nodes to a point | |
List< CloseNode > | FarthestNodes (Vector3 point, int desiredNodes, bool IgnorePassableProperty) |
returns the three closest nodes to a point | |
Node | FarthestNode (float PtX, float PtY, float PtZ, out float Distance, bool IgnorePassableProperty) |
This function will find the farthest node from a geographical position in space. |
Properties | |
Node | this[int key] [get] |
Dictionary< int, Node > | Nodes [get, set] |
Gets the List interface of the nodes in the graph. | |
HashSet< Arc > | Arcs [get] |
Gets the List interface of the arcs in the graph. | |
int | freeId [get] |
Graph structure. It is defined with : It is defined with both a list of nodes and a list of arcs.
Pathfinding.Graph.Graph | ( | ) |
Constructor.
Adds the two opposite arcs between both specified nodes to the graph.
ArgumentException | Cannot add an arc if one of its extremity nodes does not belong to the graph. |
Node1 | |
Node2 | |
Weight |
bool Pathfinding.Graph.AddArc | ( | Arc | NewArc | ) |
Directly Adds an arc to the graph.
ArgumentException | Cannot add an arc if one of its extremity nodes does not belong to the graph. |
NewArc | The arc to add. |
Creates an arc between two nodes that are already registered in the graph, adds it to the graph and returns its reference.
ArgumentException | Cannot add an arc if one of its extremity nodes does not belong to the graph. |
StartNode | Start node for the arc. |
EndNode | End node for the arc. |
Weight | Weight for the arc. |
Node Pathfinding.Graph.AddNode | ( | float | x, |
float | y, | ||
float | z ) |
Creates a node, adds to the graph and returns its reference.
x | X coordinate. |
y | Y coordinate. |
z | Z coordinate. |
Node Pathfinding.Graph.AddNode | ( | float | x, |
float | y, | ||
float | z, | ||
int | id, | ||
int[] | ignore ) |
Creates a node, adds to the graph and returns its reference.
x | X coordinate. |
y | Y coordinate. |
z | Z coordinate. |
id | Id of the node |
bool Pathfinding.Graph.AddNode | ( | Node | NewNode | ) |
Directly Adds a node to the graph.
NewNode | The node to add. |
Node Pathfinding.Graph.AddNode | ( | Vector3 | xyz, |
int | id, | ||
int[] | ignore ) |
Creates a node, adds to the graph and returns its reference.
x | X coordinate. |
y | Y coordinate. |
z | Z coordinate. |
id | Id of the node |
void Pathfinding.Graph.Clear | ( | ) |
Empties the graph.
Node Pathfinding.Graph.CloestNode | ( | Vector3 | point | ) |
Arc Pathfinding.Graph.ClosestArc2D | ( | Vector3 | point, |
out float | distance ) |
Node Pathfinding.Graph.ClosestNode | ( | float | PtX, |
float | PtY, | ||
float | PtZ, | ||
out float | Distance, | ||
bool | IgnorePassableProperty ) |
This function will find the closest node from a geographical position in space.
PtX | X coordinate of the point from which you want the closest node. |
PtY | Y coordinate of the point from which you want the closest node. |
PtZ | Z coordinate of the point from which you want the closest node. |
Distance | The distance to the closest node. |
IgnorePassableProperty | if 'false', then nodes whose property Passable is set to false will not be taken into account. |
Node Pathfinding.Graph.ClosestNode | ( | Vector3 | point, |
out float | Distance, | ||
bool | IgnorePassableProperty ) |
Node Pathfinding.Graph.ClosestNode2D | ( | Vector3 | point | ) |
List< CloseNode > Pathfinding.Graph.ClosestNodes | ( | Vector3 | point, |
int | desiredNodes, | ||
bool | IgnorePassableProperty ) |
returns the three closest nodes to a point
point | |
IgnorePassableProperty |
Node Pathfinding.Graph.FarthestNode | ( | float | PtX, |
float | PtY, | ||
float | PtZ, | ||
out float | Distance, | ||
bool | IgnorePassableProperty ) |
This function will find the farthest node from a geographical position in space.
PtX | X coordinate of the point from which you want the closest node. |
PtY | Y coordinate of the point from which you want the closest node. |
PtZ | Z coordinate of the point from which you want the closest node. |
Distance | The distance to the closest node. |
IgnorePassableProperty | if 'false', then nodes whose property Passable is set to false will not be taken into account. |
List< CloseNode > Pathfinding.Graph.FarthestNodes | ( | Vector3 | point, |
int | desiredNodes, | ||
bool | IgnorePassableProperty ) |
returns the three closest nodes to a point
point | |
IgnorePassableProperty |
List< int > Pathfinding.Graph.FreeIds | ( | int | wanted | ) |
Node Pathfinding.Graph.NodeById | ( | int | id | ) |
void Pathfinding.Graph.RemoveAllArcs | ( | ) |
bool Pathfinding.Graph.RemoveArc | ( | Arc | ArcToRemove | ) |
Removes a node from the graph as well as the linked arcs.
ArcToRemove | The arc to remove. |
bool Pathfinding.Graph.RemoveNode | ( | Node | NodeToRemove | ) |
Removes a node from the graph as well as the linked arcs.
NodeToRemove | The node to remove. |
IEnumerable< Node > Pathfinding.Graph.Search | ( | Vector3 | loc, |
float | maxRange ) |
|
get |
Gets the List interface of the arcs in the graph.
|
get |
|
getset |
Gets the List interface of the nodes in the graph.
|
get |