The navigation mesh adjacency graph node. It corresponds to a convex polygon in the navigation mesh.
More...
#include <NavMeshNode.h>
|
NavMeshEdge ** | _edges |
| An array of edges connecting to other nodes.
|
|
size_t | _edgeCount |
| The number of edges connecting to this node.
|
|
NavMeshObstacle ** | _obstacles |
| An array of obstacles connected to this node.
|
|
size_t | _obstCount |
| The number of obstacles connecting to this node.
|
|
Vector2 | _center |
| The "position" of the node - used to compute distance between node and goal (A* heuristic)
|
|
NavMeshPoly | _poly |
| The polygon associated with this node.
|
|
unsigned int | _id |
| The identifier of this node.
|
|
|
class | NavMesh |
|
class | NavMeshEdge |
|
class | PathPlanner |
|
The navigation mesh adjacency graph node. It corresponds to a convex polygon in the navigation mesh.
bool Menge::NavMeshNode::containsPoint |
( |
const Vector2 & |
point | ) |
const |
|
inline |
Reports if the given point is inside the polygon.
- Parameters
-
- Returns
- A boolean reporting if the point lies inside the polygon (true) or outside (false ). // TODO: What about the boundary?
Vector2 Menge::NavMeshNode::getCenter |
( |
| ) |
const |
|
inline |
Reports the center (centroid) of the node's polygon.
- Returns
- The position of the polygon's centroid.
Vector3 Menge::NavMeshNode::getCenter3D |
( |
| ) |
const |
|
inline |
Reports the center (centroid) of the node's polygon.
- Returns
- The position of the polygon's centroid.
NavMeshEdge * Menge::NavMeshNode::getConnection |
( |
unsigned |
nodeID | ) |
|
Returns the pointer to the edge connecting this node with the node whose identifier is given.
- Parameters
-
nodeID | The id of the desired adjacent node. |
- Returns
- The pointer to the edge connecting the two nodes. If the nodes are not connected, NULL is returned.
Retrieves the ith edge connected to this node.
- Parameters
-
i | The local index of the desired edge. |
- Returns
- A pointer to the ith edge.
const NavMeshEdge* Menge::NavMeshNode::getEdge |
( |
size_t |
i | ) |
const |
|
inline |
Retrieves a const pointer to the ith edge connected to this node.
- Parameters
-
i | The local index of the desired edge. |
- Returns
- A pointer to the ith edge.
size_t Menge::NavMeshNode::getEdgeCount |
( |
| ) |
const |
|
inline |
Reports the number of edges on the node.
- Returns
- The number of edges.
const NavMeshNode * Menge::NavMeshNode::getNeighbor |
( |
size_t |
i | ) |
const |
Returns a pointer to the ith neighbor.
- Parameters
-
i | The index of the neighboring node to retrieve. The index is defined in the range [0, N-1], where this node has N neighbors. |
- Returns
- A pointer to the ith neighboring node.
Returns a const pointer to the ith obstacle in the node.
- Parameters
-
i | The local index of the desired obstacle. |
- Returns
- A const pointer to the ith obstacle.
Returns a const pointer to the ith obstacle in the node.
- Parameters
-
i | The local index of the desired obstacle. |
- Returns
- A pointer to the ith obstacle.
size_t Menge::NavMeshNode::getObstacleCount |
( |
| ) |
const |
|
inline |
Returns the number of obstacles connected to this node.
- Returns
- The number of obtacles in on this node.
size_t Menge::NavMeshNode::getVertexCount |
( |
| ) |
const |
|
inline |
Returns the number of vertices in the node's polygon.
- Returns
- The number of vertices in the polygon.
unsigned int Menge::NavMeshNode::getVertexID |
( |
size_t |
i | ) |
const |
|
inline |
Gets the index of the ith vertex in this node's polygon.
- Parameters
-
i | The local index of the vertex in the node's polygon. |
- Returns
- The global index in the navigation mesh of the ith vertex in this node's polygon.
bool Menge::NavMeshNode::loadFromAscii |
( |
std::ifstream & |
f | ) |
|
Sets the node properties from a node definition in the given ascii file stream.
- Parameters
-
- Returns
- A boolean indicating successful parsing (true) or failure (false).
void Menge::NavMeshNode::setCenter |
( |
const Vector2 & |
c | ) |
|
|
inline |
Sets the node's center value.
- Parameters
-
void Menge::NavMeshNode::setID |
( |
unsigned int |
id | ) |
|
|
inline |
Sets the node identifier.
- Parameters
-
id | The identifier to set this node to. |
void Menge::NavMeshNode::setVertices |
( |
const Vector2 * |
vertices | ) |
|
|
inline |
Sets this node's polygon to the given vertex array. The polygon can then evaluate its indices with respect to this array of vertex values.
- Parameters
-
vertices | An array of Vector2's defining the polygon vertices. |
The documentation for this class was generated from the following files:
- src/menge/MengeCore/resources/NavMeshNode.h
- src/menge/MengeCore/resources/NavMeshNode.cpp