Class for indicating how the location of the agent is defined. Either by a portal path or a node.
More...
#include <NavMeshLocalizer.h>
|
|
union { |
|
size_t _nodeID |
| |
|
PortalPath * _path |
| |
| }; | |
| | Location information. If the agent has a path it is a pointer to that path. Otherwise, it is an index into the navigation mesh.
|
| |
|
bool | _hasPath |
| | Determines interpretation of the location union. If true, _path contains a pointer. Otherwise, _nodeID is an index in the navigation mesh.
|
| |
|
|
static const unsigned int | NO_NODE = std::numeric_limits< unsigned int >::max() |
| | Signal for indicating that the position is NOT on the navigation mesh.
|
| |
Class for indicating how the location of the agent is defined. Either by a portal path or a node.
| Menge::NavMeshLocation::NavMeshLocation |
( |
unsigned int |
nodeID | ) |
|
|
inline |
Constructor Initializes the location to being a node id.
- Parameters
-
| nodeID | The identifier of a nav mesh node. |
| Menge::NavMeshLocation::NavMeshLocation |
( |
PortalPath * |
path | ) |
|
|
inline |
Constructor Initializes the location to being a path. The NavMeshLocation takes responsibility for deleting the path.
- Parameters
-
| path | A pointer to a path. This class takes responsibility for freeing the memory. |
| unsigned int Menge::NavMeshLocation::getNode |
( |
| ) |
const |
Reports the node the agent is currently in.
- Returns
- The index of the node associated with this location. If the location is not on a node, PortalPath::NO_NODE is returned.
| bool Menge::NavMeshLocation::isNode |
( |
| ) |
const |
|
inline |
Reports if the location is a node.
- Returns
- True if the location is a node, false if a path.
| bool Menge::NavMeshLocation::isPath |
( |
| ) |
const |
|
inline |
Reports if the location is a path.
- Returns
- True if the location is a path, false if a node.
| void Menge::NavMeshLocation::setNode |
( |
unsigned int |
nodeID | ) |
|
Sets the current position to being a node.
- Parameters
-
| nodeID | The identifier of the navigation mesh node for the location. If the location was previously a path, the path is deleted. |
| void Menge::NavMeshLocation::setPath |
( |
PortalPath * |
path | ) |
|
Sets the current position to being the given path.
- Parameters
-
| path | The path for defining the current location. The locator takes responsibility for deleting the path. |
The documentation for this class was generated from the following files:
- src/menge/MengeCore/resources/NavMeshLocalizer.h
- src/menge/MengeCore/resources/NavMeshLocalizer.cpp