|
| NAVMESH_API | dtNavMesh () |
| |
| NAVMESH_API | ~dtNavMesh () |
| |
| dtReal | getWalkableHeight () const |
| |
| dtReal | getWalkableRadius () const |
| |
| dtReal | getWalkableClimb () const |
| |
| dtReal | getBVQuantFactor (const unsigned char resolution) const |
| |
|
| NAVMESH_API dtStatus | init (const dtNavMeshParams *params) |
| |
| NAVMESH_API dtStatus | init (unsigned char *data, const int dataSize, const int flags) |
| |
| NAVMESH_API const dtNavMeshParams * | getParams () const |
| | The navigation mesh initialization params.
|
| |
| NAVMESH_API dtStatus | addTile (unsigned char *data, int dataSize, int flags, dtTileRef lastRef, dtTileRef *result) |
| |
| NAVMESH_API dtStatus | removeTile (dtTileRef ref, unsigned char **data, int *dataSize) |
| |
|
| NAVMESH_API void | calcTileLoc (const dtReal *pos, int *tx, int *ty) const |
| |
| NAVMESH_API bool | isTileLocInValidRange (const dtReal *pos) const |
| |
| NAVMESH_API const dtMeshTile * | getTileAt (const int x, const int y, const int layer) const |
| |
| NAVMESH_API int | getTileCountAt (const int x, const int y) const |
| |
| NAVMESH_API int | getTilesAt (const int x, const int y, dtMeshTile const **tiles, const int maxTiles) const |
| |
| NAVMESH_API dtTileRef | getTileRefAt (int x, int y, int layer) const |
| |
| NAVMESH_API dtTileRef | getTileRef (const dtMeshTile *tile) const |
| |
| NAVMESH_API const dtMeshTile * | getTileByRef (dtTileRef ref) const |
| |
| NAVMESH_API dtMeshTile * | getMutableTileByRef (dtTileRef ref) const |
| |
| NAVMESH_API int | getMaxTiles () const |
| |
| NAVMESH_API const dtMeshTile * | getTile (int i) const |
| |
| NAVMESH_API dtStatus | getTileAndPolyByRef (const dtPolyRef ref, const dtMeshTile **tile, const dtPoly **poly) const |
| |
| NAVMESH_API void | getTileAndPolyByRefUnsafe (const dtPolyRef ref, const dtMeshTile **tile, const dtPoly **poly) const |
| |
| NAVMESH_API bool | isValidPolyRef (dtPolyRef ref) const |
| |
| NAVMESH_API dtPolyRef | getPolyRefBase (const dtMeshTile *tile) const |
| |
| NAVMESH_API dtClusterRef | getClusterRefBase (const dtMeshTile *tile) const |
| |
| NAVMESH_API dtStatus | getOffMeshConnectionPolyEndPoints (dtPolyRef prevRef, dtPolyRef polyRef, const dtReal *currentPos, dtReal *startPos, dtReal *endPos) const |
| |
| NAVMESH_API const dtOffMeshConnection * | getOffMeshConnectionByRef (dtPolyRef ref) const |
| |
| NAVMESH_API void | updateOffMeshConnectionByUserId (unsigned long long int userId, unsigned char newArea, unsigned short newFlags) |
| |
|
These functions do not effect dtTileRef or dtPolyRef's.
|
| NAVMESH_API dtStatus | setPolyFlags (dtPolyRef ref, unsigned short flags) |
| |
| NAVMESH_API dtStatus | getPolyFlags (dtPolyRef ref, unsigned short *resultFlags) const |
| |
| NAVMESH_API dtStatus | setPolyArea (dtPolyRef ref, unsigned char area) |
| |
| NAVMESH_API dtStatus | getPolyArea (dtPolyRef ref, unsigned char *resultArea) const |
| |
| NAVMESH_API int | getTileStateSize (const dtMeshTile *tile) const |
| |
| NAVMESH_API dtStatus | storeTileState (const dtMeshTile *tile, unsigned char *data, const int maxDataSize) const |
| |
| NAVMESH_API dtStatus | restoreTileState (dtMeshTile *tile, const unsigned char *data, const int maxDataSize) |
| |
|
These functions are generally meant for internal use only.
|
| dtPolyRef | encodePolyId (unsigned int salt, unsigned int it, unsigned int ip) const |
| |
| void | decodePolyId (dtPolyRef ref, unsigned int &salt, unsigned int &it, unsigned int &ip) const |
| |
| unsigned int | decodePolyIdSalt (dtPolyRef ref) const |
| |
| unsigned int | decodePolyIdTile (dtPolyRef ref) const |
| |
| unsigned int | decodePolyIdPoly (dtPolyRef ref) const |
| |
| unsigned int | decodeClusterIdTile (dtClusterRef ref) const |
| |
| NAVMESH_API void | applyWorldOffset (const dtReal *offset) |
| | Shift navigation mesh by provided offset.
|
| |
| dtLink & | getLink (dtMeshTile *tile, unsigned int linkIdx) |
| | Helper for accessing links.
|
| |
| const dtLink & | getLink (const dtMeshTile *tile, unsigned int linkIdx) const |
| |
| NAVMESH_API void | linkOffMeshHelper (dtMeshTile *tile0, unsigned int polyIdx0, const dtMeshTile *tile1, unsigned int polyIdx1, unsigned char side, unsigned char edge) |
| | Helper for creating links in off-mesh connections.
|
| |
| bool | isEmpty () const |
| |
| unsigned int | getSaltBits () const |
| |
| NAVMESH_API void | applyAreaCostOrder (unsigned char *costOrder) |
| |
| NAVMESH_API int | getNeighbourTilesCountAt (const int x, const int y, const int side) const |
| | Returns neighbour tile count based on side of given tile.
|
| |
| bool | getNeighbourCoords (const int x, const int y, const int side, int &outX, int &outY) const |
| |
| unsigned int | getTileIndex (const dtMeshTile *tile) const |
| |
A navigation mesh based on tiles of convex polygons.
The navigation mesh consists of one or more tiles defining three primary types of structural data:
A polygon mesh which defines most of the navigation graph. (See rcPolyMesh for its structure.) A detail mesh used for determining surface height on the polygon mesh. (See rcPolyMeshDetail for its structure.) Off-mesh connections, which define custom point-to-point edges within the navigation graph.
The general build process is as follows:
- Create rcPolyMesh and rcPolyMeshDetail data using the Recast build pipeline.
- Optionally, create off-mesh connection data.
- Combine the source data into a dtNavMeshCreateParams structure.
- Create a tile data array using dtCreateNavMeshData().
- Allocate at dtNavMesh object and initialize it. (For single tile navigation meshes, the tile data is loaded during this step.)
- For multi-tile navigation meshes, load the tile data using dtNavMesh::addTile().
Notes:
- This class is usually used in conjunction with the dtNavMeshQuery class for pathfinding.
- Technically, all navigation meshes are tiled. A 'solo' mesh is simply a navigation mesh initialized to have only a single tile.
- This class does not implement any asynchronous methods. So the dtStatus result of all methods will always contain either a success or failure flag.
- See also
- dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, dtAllocNavMesh, dtFreeNavMesh
Gets the endpoints for an off-mesh connection, ordered by "direction of travel".
- Parameters
-
| [in] | prevRef | The reference of the polygon before the connection. |
| [in] | polyRef | The reference of the off-mesh connection polygon. |
| [in] | currentPos | Position before entering off-mesh connection [(x, y, z)] |
| [out] | startPos | The start position of the off-mesh connection. [(x, y, z)] |
| [out] | endPos | The end position of the off-mesh connection. [(x, y, z)] |
- Returns
- The status flags for the operation.
Off-mesh connections are stored in the navigation mesh as special 2-vertex polygons with a single edge. At least one of the vertices is expected to be inside a normal polygon. So an off-mesh connection is "entered" from a normal polygon at one of its endpoints. This is the polygon identified by the prevRef parameter. For segment links, find the starting position closest to currentPos return the end position closest to that starting position. If currentPos is not provided, use the midpoint on the starting edge as the starting position.