Recast Navigation
Navigation-mesh Toolset for Games
dtTileCache Class Reference

#include <DetourTileCache.h>

Public Member Functions

 dtTileCache ()
 
 ~dtTileCache ()
 
struct dtTileCacheAllocgetAlloc ()
 
struct dtTileCacheCompressorgetCompressor ()
 
const dtTileCacheParamsgetParams () const
 
int getTileCount () const
 
const dtCompressedTilegetTile (const int i) const
 
int getObstacleCount () const
 
const dtTileCacheObstaclegetObstacle (const int i) const
 
const dtTileCacheObstaclegetObstacleByRef (dtObstacleRef ref)
 
dtObstacleRef getObstacleRef (const dtTileCacheObstacle *obmin) const
 
dtStatus init (const dtTileCacheParams *params, struct dtTileCacheAlloc *talloc, struct dtTileCacheCompressor *tcomp, struct dtTileCacheMeshProcess *tmproc)
 
int getTilesAt (const int tx, const int ty, dtCompressedTileRef *tiles, const int maxTiles) const
 
dtCompressedTilegetTileAt (const int tx, const int ty, const int tlayer)
 
dtCompressedTileRef getTileRef (const dtCompressedTile *tile) const
 
const dtCompressedTilegetTileByRef (dtCompressedTileRef ref) const
 
dtStatus addTile (unsigned char *data, const int dataSize, unsigned char flags, dtCompressedTileRef *result)
 
dtStatus removeTile (dtCompressedTileRef ref, unsigned char **data, int *dataSize)
 
dtStatus addObstacle (const float *pos, const float radius, const float height, dtObstacleRef *result)
 
dtStatus addBoxObstacle (const float *bmin, const float *bmax, dtObstacleRef *result)
 
dtStatus addBoxObstacle (const float *center, const float *halfExtents, const float yRadians, dtObstacleRef *result)
 
dtStatus removeObstacle (const dtObstacleRef ref)
 
dtStatus queryTiles (const float *bmin, const float *bmax, dtCompressedTileRef *results, int *resultCount, const int maxResults) const
 
dtStatus update (const float dt, class dtNavMesh *navmesh, bool *upToDate=0)
 Updates the tile cache by rebuilding tiles touched by unfinished obstacle requests. More...
 
dtStatus buildNavMeshTilesAt (const int tx, const int ty, class dtNavMesh *navmesh)
 
dtStatus buildNavMeshTile (const dtCompressedTileRef ref, class dtNavMesh *navmesh)
 
void calcTightTileBounds (const struct dtTileCacheLayerHeader *header, float *bmin, float *bmax) const
 
void getObstacleBounds (const struct dtTileCacheObstacle *ob, float *bmin, float *bmax) const
 
dtCompressedTileRef encodeTileId (unsigned int salt, unsigned int it) const
 Encodes a tile id. More...
 
unsigned int decodeTileIdSalt (dtCompressedTileRef ref) const
 Decodes a tile salt. More...
 
unsigned int decodeTileIdTile (dtCompressedTileRef ref) const
 Decodes a tile id. More...
 
dtObstacleRef encodeObstacleId (unsigned int salt, unsigned int it) const
 Encodes an obstacle id. More...
 
unsigned int decodeObstacleIdSalt (dtObstacleRef ref) const
 Decodes an obstacle salt. More...
 
unsigned int decodeObstacleIdObstacle (dtObstacleRef ref) const
 Decodes an obstacle id. More...
 

Constructor & Destructor Documentation

◆ dtTileCache()

dtTileCache::dtTileCache ( )

◆ ~dtTileCache()

dtTileCache::~dtTileCache ( )

Member Function Documentation

◆ addBoxObstacle() [1/2]

dtStatus dtTileCache::addBoxObstacle ( const float *  bmin,
const float *  bmax,
dtObstacleRef result 
)

◆ addBoxObstacle() [2/2]

dtStatus dtTileCache::addBoxObstacle ( const float *  center,
const float *  halfExtents,
const float  yRadians,
dtObstacleRef result 
)

◆ addObstacle()

dtStatus dtTileCache::addObstacle ( const float *  pos,
const float  radius,
const float  height,
dtObstacleRef result 
)

◆ addTile()

dtStatus dtTileCache::addTile ( unsigned char *  data,
const int  dataSize,
unsigned char  flags,
dtCompressedTileRef result 
)

◆ buildNavMeshTile()

dtStatus dtTileCache::buildNavMeshTile ( const dtCompressedTileRef  ref,
class dtNavMesh navmesh 
)

◆ buildNavMeshTilesAt()

dtStatus dtTileCache::buildNavMeshTilesAt ( const int  tx,
const int  ty,
class dtNavMesh navmesh 
)

◆ calcTightTileBounds()

void dtTileCache::calcTightTileBounds ( const struct dtTileCacheLayerHeader header,
float *  bmin,
float *  bmax 
) const

◆ decodeObstacleIdObstacle()

unsigned int dtTileCache::decodeObstacleIdObstacle ( dtObstacleRef  ref) const
inline

Decodes an obstacle id.

◆ decodeObstacleIdSalt()

unsigned int dtTileCache::decodeObstacleIdSalt ( dtObstacleRef  ref) const
inline

Decodes an obstacle salt.

◆ decodeTileIdSalt()

unsigned int dtTileCache::decodeTileIdSalt ( dtCompressedTileRef  ref) const
inline

Decodes a tile salt.

◆ decodeTileIdTile()

unsigned int dtTileCache::decodeTileIdTile ( dtCompressedTileRef  ref) const
inline

Decodes a tile id.

◆ encodeObstacleId()

dtObstacleRef dtTileCache::encodeObstacleId ( unsigned int  salt,
unsigned int  it 
) const
inline

Encodes an obstacle id.

◆ encodeTileId()

dtCompressedTileRef dtTileCache::encodeTileId ( unsigned int  salt,
unsigned int  it 
) const
inline

Encodes a tile id.

◆ getAlloc()

struct dtTileCacheAlloc* dtTileCache::getAlloc ( )
inline

◆ getCompressor()

struct dtTileCacheCompressor* dtTileCache::getCompressor ( )
inline

◆ getObstacle()

const dtTileCacheObstacle* dtTileCache::getObstacle ( const int  i) const
inline

◆ getObstacleBounds()

void dtTileCache::getObstacleBounds ( const struct dtTileCacheObstacle ob,
float *  bmin,
float *  bmax 
) const

◆ getObstacleByRef()

const dtTileCacheObstacle * dtTileCache::getObstacleByRef ( dtObstacleRef  ref)

◆ getObstacleCount()

int dtTileCache::getObstacleCount ( ) const
inline

◆ getObstacleRef()

dtObstacleRef dtTileCache::getObstacleRef ( const dtTileCacheObstacle obmin) const

◆ getParams()

const dtTileCacheParams* dtTileCache::getParams ( ) const
inline

◆ getTile()

const dtCompressedTile* dtTileCache::getTile ( const int  i) const
inline

◆ getTileAt()

dtCompressedTile * dtTileCache::getTileAt ( const int  tx,
const int  ty,
const int  tlayer 
)

◆ getTileByRef()

const dtCompressedTile * dtTileCache::getTileByRef ( dtCompressedTileRef  ref) const

◆ getTileCount()

int dtTileCache::getTileCount ( ) const
inline

◆ getTileRef()

dtCompressedTileRef dtTileCache::getTileRef ( const dtCompressedTile tile) const

◆ getTilesAt()

int dtTileCache::getTilesAt ( const int  tx,
const int  ty,
dtCompressedTileRef tiles,
const int  maxTiles 
) const

◆ init()

dtStatus dtTileCache::init ( const dtTileCacheParams params,
struct dtTileCacheAlloc talloc,
struct dtTileCacheCompressor tcomp,
struct dtTileCacheMeshProcess tmproc 
)

◆ queryTiles()

dtStatus dtTileCache::queryTiles ( const float *  bmin,
const float *  bmax,
dtCompressedTileRef results,
int *  resultCount,
const int  maxResults 
) const

◆ removeObstacle()

dtStatus dtTileCache::removeObstacle ( const dtObstacleRef  ref)

◆ removeTile()

dtStatus dtTileCache::removeTile ( dtCompressedTileRef  ref,
unsigned char **  data,
int *  dataSize 
)

◆ update()

dtStatus dtTileCache::update ( const float  dt,
class dtNavMesh navmesh,
bool *  upToDate = 0 
)

Updates the tile cache by rebuilding tiles touched by unfinished obstacle requests.

Parameters
[in]dtThe time step size. Currently not used.
[in]navmeshThe mesh to affect when rebuilding tiles.
[out]upToDateWhether the tile cache is fully up to date with obstacle requests and tile rebuilds. If the tile cache is up to date another (immediate) call to update will have no effect; otherwise another call will continue processing obstacle requests and tile rebuilds.

The documentation for this class was generated from the following files: