The polygon used in each node of a navigation mesh graph.
More...
#include <NavMeshPoly.h>
|
unsigned int * | _vertIDs |
| An array of indices into the vertex list defining the polygon. The indices must be ordered such that the vertices are visited in a counter-clockwise order. More...
|
|
size_t | _vertCount |
| The number of vertices in the polygon.
|
|
const Vector2 * | _vertices |
| A pointer to the mesh vertex information for performing geometric tests.
|
|
float | _minX |
| Minimum extent on the x-axis of the polygon.
|
|
float | _maxX |
| Maximum extent on the x-axis of the polygon.
|
|
float | _minY |
| Minimum extent on the y-axis of the polygon.
|
|
float | _maxY |
| Maximum extent on the y-axis of the polygon.
|
|
float | _A |
| The first coefficient of the planar equation: f( x, y ) = Ax + By + C Used to compute the elevation of the point on the polygon.
|
|
float | _B |
| The second coefficient of the planar equation: f( x, y ) = Ax + By + C Used to compute the elevation of the point on the polygon.
|
|
float | _C |
| The third coefficient of the planar equation: f( x, y ) = Ax + By + C Used to compute the elevation of the point on the polygon.
|
|
|
class | NavMeshNode |
|
class | NavMesh |
|
The polygon used in each node of a navigation mesh graph.
bool Menge::NavMeshPoly::containsPoint |
( |
const Vector2 & |
point | ) |
const |
Reports if the point lies inside the polygon. NOTE: This is limited to 2D polygons.
- Parameters
-
- Returns
- A boolean reporting if the point is inside (true) or outside (false) the polygon TODO: Figure out what I do w.r.t. boundaries.
float Menge::NavMeshPoly::getElevation |
( |
const Vector2 & |
point | ) |
const |
Computes the elevation of the polygon at the given point.
- Parameters
-
point | A point on the polygon to evaluate. The function does not test to see if the point lies inside the polygon. |
- Returns
- The elevation of the polygon at the given point.
Vector2 Menge::NavMeshPoly::getGradient |
( |
| ) |
const |
|
inline |
Reports the gradient of the polygon. Because it is a plane, the gradient is constant at all positions.
- Returns
- The gradient of the plane.
void Menge::NavMeshPoly::initialize |
( |
size_t |
vCount, |
|
|
unsigned int * |
ids, |
|
|
float |
A = 0.f , |
|
|
float |
B = 0.f , |
|
|
float |
C = 0.f |
|
) |
| |
Initialize the polygon with vertices and equation of plane.
- Parameters
-
vCount | Number of vertices in the polygon. |
ids | An array of index values into the global set of vertices in the navigation mesh. |
A | The first coefficient of the planar equation: f( x, y ) = Ax + By + C |
B | The second coefficient of the planar equation: f( x, y ) = Ax + By + C |
C | The third coefficient of the planar equation: f( x, y ) = Ax + By + C |
bool Menge::NavMeshPoly::loadFromAscii |
( |
std::ifstream & |
f | ) |
|
Sets the polygon properties from a polygon definition in the given ascii file stream.
- Parameters
-
- Returns
- A boolean indicating successful parsing (true) or failure (false).
bool Menge::NavMeshPoly::loadFromBinary |
( |
std::ifstream & |
f | ) |
|
Sets the polygon properties from a polygon definition in the given binary file stream.
- Parameters
-
- Returns
- A boolean indicating successful parsing (true) or failure (false).
void Menge::NavMeshPoly::setBB |
( |
const Vector2 * |
vertices | ) |
|
|
protected |
Compute the bounding box for this polygon.
- Parameters
-
vertices | The actucal vertices used for geometric queries. |
unsigned int* Menge::NavMeshPoly::_vertIDs |
|
protected |
An array of indices into the vertex list defining the polygon. The indices must be ordered such that the vertices are visited in a counter-clockwise order.
TODO: These are unsigned ints because of the binary file format. It would be better to decouple the file format from the representation.
The documentation for this class was generated from the following files:
- src/menge/MengeCore/resources/NavMeshPoly.h
- src/menge/MengeCore/resources/NavMeshPoly.cpp