Path Finder (2D/3D) 1.0.1
Create and use simple navigation graphs for 2D/3D path finding with choice of 4 search algorithms.
|
Public Member Functions | |
GraphNode (int id) | |
GraphNode (int id, double x, double y, double z) | |
GraphNode (int id, double x, double y) | |
int | id () |
void | id (int id) |
double | x () |
float | xf () |
void | x (float x) |
double | y () |
float | yf () |
void | y (float y) |
double | z () |
float | zf () |
void | z (float z) |
int | compareTo (Object o) |
Protected Attributes | |
int | id |
This class represents a node (vertex) that can be used with the Graph class.
The node has a position in 3D space for 2D applications the z value should be zero.
Each node should be given a unique ID number >= 0. Node ID numbers do not need to start at 0 (zero) or be sequential but they must be unique.
It is the responsibility of the user to ensure that each node ID is unique as duplicate ID numbers can lead to unpredictable behaviour.
pathfinder.GraphNode.GraphNode | ( | int | id | ) |
Create a node with a given ID
id |
pathfinder.GraphNode.GraphNode | ( | int | id, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Create a node
id | unique id number for this node |
x | |
y | |
z | set to 0 (zero for 2D applications |
pathfinder.GraphNode.GraphNode | ( | int | id, |
double | x, | ||
double | y | ||
) |
Create a node
id | unique id number for this node |
x | |
y |
int pathfinder.GraphNode.compareTo | ( | Object | o | ) |
Compare nodes based on ID number.
int pathfinder.GraphNode.id | ( | ) |
Get the node ID
void pathfinder.GraphNode.id | ( | int | id | ) |
Change the node id.
Care should be taken to ensure the new ID number is unique
id | the id to set |
double pathfinder.GraphNode.x | ( | ) |
void pathfinder.GraphNode.x | ( | float | x | ) |
x | the new x position |
float pathfinder.GraphNode.xf | ( | ) |
double pathfinder.GraphNode.y | ( | ) |
void pathfinder.GraphNode.y | ( | float | y | ) |
y | the new y position |
float pathfinder.GraphNode.yf | ( | ) |
double pathfinder.GraphNode.z | ( | ) |
void pathfinder.GraphNode.z | ( | float | z | ) |
z | the new z position |
float pathfinder.GraphNode.zf | ( | ) |