mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix incorrect renaming
Everything 'dtAlloc', 'rcAlloc', 'dtAlloc', 'dtFree', got renamed into 'rdAlloc', 'rdFree'. There were a lot of object allocators that used these suffixes which were not accounted for causing those to be renamed. Everything has been renamed back to their original names (excluding the actual rdAlloc/rdFree functions as these were supposed to be renamed). No code logic was changed in this commit. The accidental renaming was caused in commit fa8d89d287752782ebdd5d9563f04fa72ef0bee9
This commit is contained in:
parent
3fbe657577
commit
c64ebe12c2
@ -115,7 +115,7 @@ CrowdToolState::CrowdToolState() :
|
|||||||
|
|
||||||
memset(m_trails, 0, sizeof(m_trails));
|
memset(m_trails, 0, sizeof(m_trails));
|
||||||
|
|
||||||
m_vod = rdAllocObstacleAvoidanceDebugData();
|
m_vod = dtAllocObstacleAvoidanceDebugData();
|
||||||
m_vod->init(2048);
|
m_vod->init(2048);
|
||||||
|
|
||||||
memset(&m_agentDebug, 0, sizeof(m_agentDebug));
|
memset(&m_agentDebug, 0, sizeof(m_agentDebug));
|
||||||
@ -125,7 +125,7 @@ CrowdToolState::CrowdToolState() :
|
|||||||
|
|
||||||
CrowdToolState::~CrowdToolState()
|
CrowdToolState::~CrowdToolState()
|
||||||
{
|
{
|
||||||
rdFreeObstacleAvoidanceDebugData(m_vod);
|
dtFreeObstacleAvoidanceDebugData(m_vod);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrowdToolState::init(class Editor* editor)
|
void CrowdToolState::init(class Editor* editor)
|
||||||
|
@ -68,8 +68,8 @@ Editor::Editor() :
|
|||||||
m_ctx(0)
|
m_ctx(0)
|
||||||
{
|
{
|
||||||
resetCommonSettings();
|
resetCommonSettings();
|
||||||
m_navQuery = rdAllocNavMeshQuery();
|
m_navQuery = dtAllocNavMeshQuery();
|
||||||
m_crowd = rdAllocCrowd();
|
m_crowd = dtAllocCrowd();
|
||||||
|
|
||||||
for (int i = 0; i < MAX_TOOLS; i++)
|
for (int i = 0; i < MAX_TOOLS; i++)
|
||||||
m_toolStates[i] = 0;
|
m_toolStates[i] = 0;
|
||||||
@ -77,9 +77,9 @@ Editor::Editor() :
|
|||||||
|
|
||||||
Editor::~Editor()
|
Editor::~Editor()
|
||||||
{
|
{
|
||||||
rdFreeNavMeshQuery(m_navQuery);
|
dtFreeNavMeshQuery(m_navQuery);
|
||||||
rdFreeNavMesh(m_navMesh);
|
dtFreeNavMesh(m_navMesh);
|
||||||
rdFreeCrowd(m_crowd);
|
dtFreeCrowd(m_crowd);
|
||||||
delete m_tool;
|
delete m_tool;
|
||||||
for (int i = 0; i < MAX_TOOLS; i++)
|
for (int i = 0; i < MAX_TOOLS; i++)
|
||||||
delete m_toolStates[i];
|
delete m_toolStates[i];
|
||||||
@ -354,7 +354,7 @@ dtNavMesh* Editor::loadAll(std::string path)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dtNavMesh* mesh = rdAllocNavMesh();
|
dtNavMesh* mesh = dtAllocNavMesh();
|
||||||
if (!mesh)
|
if (!mesh)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
@ -48,7 +48,7 @@ Editor_Debug::Editor_Debug() :
|
|||||||
resetCommonSettings();
|
resetCommonSettings();
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
/* m_chf = rdAllocCompactHeightfield();
|
/* m_chf = rcAllocCompactHeightfield();
|
||||||
FileIO io;
|
FileIO io;
|
||||||
if (!io.openForRead("test.chf"))
|
if (!io.openForRead("test.chf"))
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ Editor_Debug::Editor_Debug() :
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
m_cset = rdAllocContourSet();
|
m_cset = rcAllocContourSet();
|
||||||
if (m_cset)
|
if (m_cset)
|
||||||
{
|
{
|
||||||
FileIO io;
|
FileIO io;
|
||||||
@ -151,7 +151,7 @@ Editor_Debug::Editor_Debug() :
|
|||||||
|
|
||||||
/* if (m_cset)
|
/* if (m_cset)
|
||||||
{
|
{
|
||||||
m_pmesh = rdAllocPolyMesh();
|
m_pmesh = rcAllocPolyMesh();
|
||||||
if (m_pmesh)
|
if (m_pmesh)
|
||||||
{
|
{
|
||||||
rcBuildPolyMesh(m_ctx, *m_cset, 6, *m_pmesh);
|
rcBuildPolyMesh(m_ctx, *m_cset, 6, *m_pmesh);
|
||||||
@ -163,9 +163,9 @@ Editor_Debug::Editor_Debug() :
|
|||||||
|
|
||||||
Editor_Debug::~Editor_Debug()
|
Editor_Debug::~Editor_Debug()
|
||||||
{
|
{
|
||||||
rdFreeCompactHeightfield(m_chf);
|
rcFreeCompactHeightfield(m_chf);
|
||||||
rdFreeContourSet(m_cset);
|
rcFreeContourSet(m_cset);
|
||||||
rdFreePolyMesh(m_pmesh);
|
rcFreePolyMesh(m_pmesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor_Debug::handleSettings()
|
void Editor_Debug::handleSettings()
|
||||||
@ -357,11 +357,11 @@ bool Editor_Debug::handleBuild()
|
|||||||
|
|
||||||
if (m_chf)
|
if (m_chf)
|
||||||
{
|
{
|
||||||
rdFreeContourSet(m_cset);
|
rcFreeContourSet(m_cset);
|
||||||
m_cset = 0;
|
m_cset = 0;
|
||||||
|
|
||||||
// Create contours.
|
// Create contours.
|
||||||
m_cset = rdAllocContourSet();
|
m_cset = rcAllocContourSet();
|
||||||
if (!m_cset)
|
if (!m_cset)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'.");
|
||||||
|
@ -195,7 +195,7 @@ Editor_TileMesh::Editor_TileMesh() :
|
|||||||
Editor_TileMesh::~Editor_TileMesh()
|
Editor_TileMesh::~Editor_TileMesh()
|
||||||
{
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
rdFreeNavMesh(m_navMesh);
|
dtFreeNavMesh(m_navMesh);
|
||||||
m_navMesh = 0;
|
m_navMesh = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,15 +203,15 @@ void Editor_TileMesh::cleanup()
|
|||||||
{
|
{
|
||||||
delete [] m_triareas;
|
delete [] m_triareas;
|
||||||
m_triareas = 0;
|
m_triareas = 0;
|
||||||
rdFreeHeightField(m_solid);
|
rcFreeHeightField(m_solid);
|
||||||
m_solid = 0;
|
m_solid = 0;
|
||||||
rdFreeCompactHeightfield(m_chf);
|
rcFreeCompactHeightfield(m_chf);
|
||||||
m_chf = 0;
|
m_chf = 0;
|
||||||
rdFreeContourSet(m_cset);
|
rcFreeContourSet(m_cset);
|
||||||
m_cset = 0;
|
m_cset = 0;
|
||||||
rdFreePolyMesh(m_pmesh);
|
rcFreePolyMesh(m_pmesh);
|
||||||
m_pmesh = 0;
|
m_pmesh = 0;
|
||||||
rdFreePolyMeshDetail(m_dmesh);
|
rcFreePolyMeshDetail(m_dmesh);
|
||||||
m_dmesh = 0;
|
m_dmesh = 0;
|
||||||
}
|
}
|
||||||
const hulldef hulls[NAVMESH_COUNT] = {
|
const hulldef hulls[NAVMESH_COUNT] = {
|
||||||
@ -296,7 +296,7 @@ void Editor_TileMesh::handleSettings()
|
|||||||
|
|
||||||
if (imguiButton("Load"))
|
if (imguiButton("Load"))
|
||||||
{
|
{
|
||||||
rdFreeNavMesh(m_navMesh);
|
dtFreeNavMesh(m_navMesh);
|
||||||
m_navMesh = Editor::loadAll(m_modelName.c_str());
|
m_navMesh = Editor::loadAll(m_modelName.c_str());
|
||||||
m_navQuery->init(m_navMesh, 2048);
|
m_navQuery->init(m_navMesh, 2048);
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ void Editor_TileMesh::handleMeshChanged(InputGeom* geom)
|
|||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
rdFreeNavMesh(m_navMesh);
|
dtFreeNavMesh(m_navMesh);
|
||||||
m_navMesh = 0;
|
m_navMesh = 0;
|
||||||
|
|
||||||
if (m_tool)
|
if (m_tool)
|
||||||
@ -673,9 +673,9 @@ bool Editor_TileMesh::handleBuild()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
rdFreeNavMesh(m_navMesh);
|
dtFreeNavMesh(m_navMesh);
|
||||||
|
|
||||||
m_navMesh = rdAllocNavMesh();
|
m_navMesh = dtAllocNavMesh();
|
||||||
if (!m_navMesh)
|
if (!m_navMesh)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not allocate navmesh.");
|
m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not allocate navmesh.");
|
||||||
@ -974,7 +974,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
m_ctx->log(RC_LOG_PROGRESS, " - %.1fK verts, %.1fK tris", nverts/1000.0f, ntris/1000.0f);
|
m_ctx->log(RC_LOG_PROGRESS, " - %.1fK verts, %.1fK tris", nverts/1000.0f, ntris/1000.0f);
|
||||||
|
|
||||||
// Allocate voxel heightfield where we rasterize our input data to.
|
// Allocate voxel heightfield where we rasterize our input data to.
|
||||||
m_solid = rdAllocHeightfield();
|
m_solid = rcAllocHeightfield();
|
||||||
if (!m_solid)
|
if (!m_solid)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'solid'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'solid'.");
|
||||||
@ -1072,7 +1072,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
// Compact the heightfield so that it is faster to handle from now on.
|
// Compact the heightfield so that it is faster to handle from now on.
|
||||||
// This will result more cache coherent data as well as the neighbours
|
// This will result more cache coherent data as well as the neighbours
|
||||||
// between walkable cells will be calculated.
|
// between walkable cells will be calculated.
|
||||||
m_chf = rdAllocCompactHeightfield();
|
m_chf = rcAllocCompactHeightfield();
|
||||||
if (!m_chf)
|
if (!m_chf)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'chf'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'chf'.");
|
||||||
@ -1086,7 +1086,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
|
|
||||||
if (!m_keepInterResults)
|
if (!m_keepInterResults)
|
||||||
{
|
{
|
||||||
rdFreeHeightField(m_solid);
|
rcFreeHeightField(m_solid);
|
||||||
m_solid = 0;
|
m_solid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1166,7 +1166,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create contours.
|
// Create contours.
|
||||||
m_cset = rdAllocContourSet();
|
m_cset = rcAllocContourSet();
|
||||||
if (!m_cset)
|
if (!m_cset)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'.");
|
||||||
@ -1184,7 +1184,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build polygon navmesh from the contours.
|
// Build polygon navmesh from the contours.
|
||||||
m_pmesh = rdAllocPolyMesh();
|
m_pmesh = rcAllocPolyMesh();
|
||||||
if (!m_pmesh)
|
if (!m_pmesh)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'.");
|
||||||
@ -1197,7 +1197,7 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build detail mesh.
|
// Build detail mesh.
|
||||||
m_dmesh = rdAllocPolyMeshDetail();
|
m_dmesh = rcAllocPolyMeshDetail();
|
||||||
if (!m_dmesh)
|
if (!m_dmesh)
|
||||||
{
|
{
|
||||||
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'.");
|
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'.");
|
||||||
@ -1216,9 +1216,9 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
|||||||
//rcFlipPolyMeshDetail(*m_dmesh,m_pmesh->nverts);
|
//rcFlipPolyMeshDetail(*m_dmesh,m_pmesh->nverts);
|
||||||
if (!m_keepInterResults)
|
if (!m_keepInterResults)
|
||||||
{
|
{
|
||||||
rdFreeCompactHeightfield(m_chf);
|
rcFreeCompactHeightfield(m_chf);
|
||||||
m_chf = 0;
|
m_chf = 0;
|
||||||
rdFreeContourSet(m_cset);
|
rcFreeContourSet(m_cset);
|
||||||
m_cset = 0;
|
m_cset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -795,12 +795,12 @@ int calcTraversalTableSize(const int numPolyGroups);
|
|||||||
/// Allocates a navigation mesh object using the Detour allocator.
|
/// Allocates a navigation mesh object using the Detour allocator.
|
||||||
/// @return A navigation mesh that is ready for initialization, or null on failure.
|
/// @return A navigation mesh that is ready for initialization, or null on failure.
|
||||||
/// @ingroup detour
|
/// @ingroup detour
|
||||||
dtNavMesh* rdAllocNavMesh();
|
dtNavMesh* dtAllocNavMesh();
|
||||||
|
|
||||||
/// Frees the specified navigation mesh object using the Detour allocator.
|
/// Frees the specified navigation mesh object using the Detour allocator.
|
||||||
/// @param[in] navmesh A navigation mesh allocated using #rdAllocNavMesh
|
/// @param[in] navmesh A navigation mesh allocated using #dtAllocNavMesh
|
||||||
/// @ingroup detour
|
/// @ingroup detour
|
||||||
void rdFreeNavMesh(dtNavMesh* navmesh);
|
void dtFreeNavMesh(dtNavMesh* navmesh);
|
||||||
|
|
||||||
#endif // DETOURNAVMESH_H
|
#endif // DETOURNAVMESH_H
|
||||||
|
|
||||||
|
@ -592,11 +592,11 @@ private:
|
|||||||
/// Allocates a query object using the Detour allocator.
|
/// Allocates a query object using the Detour allocator.
|
||||||
/// @return An allocated query object, or null on failure.
|
/// @return An allocated query object, or null on failure.
|
||||||
/// @ingroup detour
|
/// @ingroup detour
|
||||||
dtNavMeshQuery* rdAllocNavMeshQuery();
|
dtNavMeshQuery* dtAllocNavMeshQuery();
|
||||||
|
|
||||||
/// Frees the specified query object using the Detour allocator.
|
/// Frees the specified query object using the Detour allocator.
|
||||||
/// @param[in] query A query object allocated using #rdAllocNavMeshQuery
|
/// @param[in] query A query object allocated using #dtAllocNavMeshQuery
|
||||||
/// @ingroup detour
|
/// @ingroup detour
|
||||||
void rdFreeNavMeshQuery(dtNavMeshQuery* query);
|
void dtFreeNavMeshQuery(dtNavMeshQuery* query);
|
||||||
|
|
||||||
#endif // DETOURNAVMESHQUERY_H
|
#endif // DETOURNAVMESHQUERY_H
|
||||||
|
@ -145,7 +145,7 @@ int calcTraversalTableSize(const int numPolyGroups)
|
|||||||
return sizeof(int)*(numPolyGroups*((numPolyGroups+(DT_BITS_PER_BIT_CELL-1))/DT_BITS_PER_BIT_CELL));
|
return sizeof(int)*(numPolyGroups*((numPolyGroups+(DT_BITS_PER_BIT_CELL-1))/DT_BITS_PER_BIT_CELL));
|
||||||
}
|
}
|
||||||
|
|
||||||
dtNavMesh* rdAllocNavMesh()
|
dtNavMesh* dtAllocNavMesh()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtNavMesh), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtNavMesh), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
@ -156,7 +156,7 @@ dtNavMesh* rdAllocNavMesh()
|
|||||||
///
|
///
|
||||||
/// This function will only free the memory for tiles with the #DT_TILE_FREE_DATA
|
/// This function will only free the memory for tiles with the #DT_TILE_FREE_DATA
|
||||||
/// flag set.
|
/// flag set.
|
||||||
void rdFreeNavMesh(dtNavMesh* navmesh)
|
void dtFreeNavMesh(dtNavMesh* navmesh)
|
||||||
{
|
{
|
||||||
if (!navmesh) return;
|
if (!navmesh) return;
|
||||||
navmesh->~dtNavMesh();
|
navmesh->~dtNavMesh();
|
||||||
@ -192,7 +192,7 @@ Notes:
|
|||||||
- This class does not implement any asynchronous methods. So the ::dtStatus result of all methods will
|
- This class does not implement any asynchronous methods. So the ::dtStatus result of all methods will
|
||||||
always contain either a success or failure flag.
|
always contain either a success or failure flag.
|
||||||
|
|
||||||
@see dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, #rdAllocNavMesh, #rdFreeNavMesh
|
@see dtNavMeshQuery, dtCreateNavMeshData, dtNavMeshCreateParams, #dtAllocNavMesh, #dtFreeNavMesh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dtNavMesh::dtNavMesh() :
|
dtNavMesh::dtNavMesh() :
|
||||||
|
@ -103,14 +103,14 @@ inline float dtQueryFilter::getCost(const float* pa, const float* pb,
|
|||||||
static const float H_SCALE = 0.999f; // Search heuristic scale.
|
static const float H_SCALE = 0.999f; // Search heuristic scale.
|
||||||
|
|
||||||
|
|
||||||
dtNavMeshQuery* rdAllocNavMeshQuery()
|
dtNavMeshQuery* dtAllocNavMeshQuery()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtNavMeshQuery), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtNavMeshQuery), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtNavMeshQuery;
|
return new(mem) dtNavMeshQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeNavMeshQuery(dtNavMeshQuery* navmesh)
|
void dtFreeNavMeshQuery(dtNavMeshQuery* navmesh)
|
||||||
{
|
{
|
||||||
if (!navmesh) return;
|
if (!navmesh) return;
|
||||||
navmesh->~dtNavMeshQuery();
|
navmesh->~dtNavMeshQuery();
|
||||||
@ -133,7 +133,7 @@ void rdFreeNavMeshQuery(dtNavMeshQuery* navmesh)
|
|||||||
/// considered impassable. A @e portal is a passable segment between polygons.
|
/// considered impassable. A @e portal is a passable segment between polygons.
|
||||||
/// A portal may be treated as a wall based on the dtQueryFilter used for a query.
|
/// A portal may be treated as a wall based on the dtQueryFilter used for a query.
|
||||||
///
|
///
|
||||||
/// @see dtNavMesh, dtQueryFilter, #rdAllocNavMeshQuery(), #rdAllocNavMeshQuery()
|
/// @see dtNavMesh, dtQueryFilter, #dtAllocNavMeshQuery(), #dtAllocNavMeshQuery()
|
||||||
|
|
||||||
dtNavMeshQuery::dtNavMeshQuery() :
|
dtNavMeshQuery::dtNavMeshQuery() :
|
||||||
m_nav(0),
|
m_nav(0),
|
||||||
|
@ -363,12 +363,12 @@ private:
|
|||||||
/// Allocates a crowd object using the Detour allocator.
|
/// Allocates a crowd object using the Detour allocator.
|
||||||
/// @return A crowd object that is ready for initialization, or null on failure.
|
/// @return A crowd object that is ready for initialization, or null on failure.
|
||||||
/// @ingroup crowd
|
/// @ingroup crowd
|
||||||
dtCrowd* rdAllocCrowd();
|
dtCrowd* dtAllocCrowd();
|
||||||
|
|
||||||
/// Frees the specified crowd object using the Detour allocator.
|
/// Frees the specified crowd object using the Detour allocator.
|
||||||
/// @param[in] ptr A crowd object allocated using #rdAllocCrowd
|
/// @param[in] ptr A crowd object allocated using #dtAllocCrowd
|
||||||
/// @ingroup crowd
|
/// @ingroup crowd
|
||||||
void rdFreeCrowd(dtCrowd* ptr);
|
void dtFreeCrowd(dtCrowd* ptr);
|
||||||
|
|
||||||
|
|
||||||
#endif // DETOURCROWD_H
|
#endif // DETOURCROWD_H
|
||||||
|
@ -73,8 +73,8 @@ private:
|
|||||||
float* m_tpen;
|
float* m_tpen;
|
||||||
};
|
};
|
||||||
|
|
||||||
dtObstacleAvoidanceDebugData* rdAllocObstacleAvoidanceDebugData();
|
dtObstacleAvoidanceDebugData* dtAllocObstacleAvoidanceDebugData();
|
||||||
void rdFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr);
|
void dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr);
|
||||||
|
|
||||||
|
|
||||||
static const int DT_MAX_PATTERN_DIVS = 32; ///< Max numver of adaptive divs.
|
static const int DT_MAX_PATTERN_DIVS = 32; ///< Max numver of adaptive divs.
|
||||||
@ -152,8 +152,8 @@ private:
|
|||||||
int m_nsegments;
|
int m_nsegments;
|
||||||
};
|
};
|
||||||
|
|
||||||
dtObstacleAvoidanceQuery* rdAllocObstacleAvoidanceQuery();
|
dtObstacleAvoidanceQuery* dtAllocObstacleAvoidanceQuery();
|
||||||
void rdFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr);
|
void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr);
|
||||||
|
|
||||||
|
|
||||||
#endif // DETOUROBSTACLEAVOIDANCE_H
|
#endif // DETOUROBSTACLEAVOIDANCE_H
|
||||||
|
@ -66,8 +66,8 @@ private:
|
|||||||
dtProximityGrid& operator=(const dtProximityGrid&);
|
dtProximityGrid& operator=(const dtProximityGrid&);
|
||||||
};
|
};
|
||||||
|
|
||||||
dtProximityGrid* rdAllocProximityGrid();
|
dtProximityGrid* dtAllocProximityGrid();
|
||||||
void rdFreeProximityGrid(dtProximityGrid* ptr);
|
void dtFreeProximityGrid(dtProximityGrid* ptr);
|
||||||
|
|
||||||
|
|
||||||
#endif // DETOURPROXIMITYGRID_H
|
#endif // DETOURPROXIMITYGRID_H
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
#include "Shared\Include\SharedAlloc.h"
|
#include "Shared\Include\SharedAlloc.h"
|
||||||
|
|
||||||
|
|
||||||
dtCrowd* rdAllocCrowd()
|
dtCrowd* dtAllocCrowd()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtCrowd), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtCrowd), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtCrowd;
|
return new(mem) dtCrowd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeCrowd(dtCrowd* ptr)
|
void dtFreeCrowd(dtCrowd* ptr)
|
||||||
{
|
{
|
||||||
if (!ptr) return;
|
if (!ptr) return;
|
||||||
ptr->~dtCrowd();
|
ptr->~dtCrowd();
|
||||||
@ -67,7 +67,7 @@ of the crowd features.
|
|||||||
|
|
||||||
A common method for setting up the crowd is as follows:
|
A common method for setting up the crowd is as follows:
|
||||||
|
|
||||||
-# Allocate the crowd using #rdAllocCrowd.
|
-# Allocate the crowd using #dtAllocCrowd.
|
||||||
-# Initialize the crowd using #init().
|
-# Initialize the crowd using #init().
|
||||||
-# Set the avoidance configurations using #setObstacleAvoidanceParams().
|
-# Set the avoidance configurations using #setObstacleAvoidanceParams().
|
||||||
-# Add agents using #addAgent() and make an initial movement request using #requestMoveTarget().
|
-# Add agents using #addAgent() and make an initial movement request using #requestMoveTarget().
|
||||||
@ -92,7 +92,7 @@ Notes:
|
|||||||
- This class is meant to provide 'local' movement. There is a limit of 256 polygons in the path corridor.
|
- This class is meant to provide 'local' movement. There is a limit of 256 polygons in the path corridor.
|
||||||
So it is not meant to provide automatic pathfinding services over long distances.
|
So it is not meant to provide automatic pathfinding services over long distances.
|
||||||
|
|
||||||
@see rdAllocCrowd(), rdFreeCrowd(), init(), dtCrowdAgent
|
@see dtAllocCrowd(), dtFreeCrowd(), init(), dtCrowdAgent
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -133,13 +133,13 @@ void dtCrowd::purge()
|
|||||||
rdFree(m_pathResult);
|
rdFree(m_pathResult);
|
||||||
m_pathResult = 0;
|
m_pathResult = 0;
|
||||||
|
|
||||||
rdFreeProximityGrid(m_grid);
|
dtFreeProximityGrid(m_grid);
|
||||||
m_grid = 0;
|
m_grid = 0;
|
||||||
|
|
||||||
rdFreeObstacleAvoidanceQuery(m_obstacleQuery);
|
dtFreeObstacleAvoidanceQuery(m_obstacleQuery);
|
||||||
m_obstacleQuery = 0;
|
m_obstacleQuery = 0;
|
||||||
|
|
||||||
rdFreeNavMeshQuery(m_navquery);
|
dtFreeNavMeshQuery(m_navquery);
|
||||||
m_navquery = 0;
|
m_navquery = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,13 +156,13 @@ bool dtCrowd::init(const int maxAgents, const float maxAgentRadius, dtNavMesh* n
|
|||||||
// Larger than agent radius because it is also used for agent recovery.
|
// Larger than agent radius because it is also used for agent recovery.
|
||||||
dtVset(m_agentPlacementHalfExtents, m_maxAgentRadius*2.0f, m_maxAgentRadius*1.5f, m_maxAgentRadius*2.0f);
|
dtVset(m_agentPlacementHalfExtents, m_maxAgentRadius*2.0f, m_maxAgentRadius*1.5f, m_maxAgentRadius*2.0f);
|
||||||
|
|
||||||
m_grid = rdAllocProximityGrid();
|
m_grid = dtAllocProximityGrid();
|
||||||
if (!m_grid)
|
if (!m_grid)
|
||||||
return false;
|
return false;
|
||||||
if (!m_grid->init(m_maxAgents*4, maxAgentRadius*3))
|
if (!m_grid->init(m_maxAgents*4, maxAgentRadius*3))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_obstacleQuery = rdAllocObstacleAvoidanceQuery();
|
m_obstacleQuery = dtAllocObstacleAvoidanceQuery();
|
||||||
if (!m_obstacleQuery)
|
if (!m_obstacleQuery)
|
||||||
return false;
|
return false;
|
||||||
if (!m_obstacleQuery->init(6, 8))
|
if (!m_obstacleQuery->init(6, 8))
|
||||||
@ -220,7 +220,7 @@ bool dtCrowd::init(const int maxAgents, const float maxAgentRadius, dtNavMesh* n
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The navquery is mostly used for local searches, no need for large node pool.
|
// The navquery is mostly used for local searches, no need for large node pool.
|
||||||
m_navquery = rdAllocNavMeshQuery();
|
m_navquery = dtAllocNavMeshQuery();
|
||||||
if (!m_navquery)
|
if (!m_navquery)
|
||||||
return false;
|
return false;
|
||||||
if (dtStatusFailed(m_navquery->init(nav, MAX_COMMON_NODES)))
|
if (dtStatusFailed(m_navquery->init(nav, MAX_COMMON_NODES)))
|
||||||
|
@ -67,14 +67,14 @@ static int isectRaySeg(const float* ap, const float* u,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
dtObstacleAvoidanceDebugData* rdAllocObstacleAvoidanceDebugData()
|
dtObstacleAvoidanceDebugData* dtAllocObstacleAvoidanceDebugData()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtObstacleAvoidanceDebugData), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtObstacleAvoidanceDebugData), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtObstacleAvoidanceDebugData;
|
return new(mem) dtObstacleAvoidanceDebugData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr)
|
void dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr)
|
||||||
{
|
{
|
||||||
if (!ptr) return;
|
if (!ptr) return;
|
||||||
ptr->~dtObstacleAvoidanceDebugData();
|
ptr->~dtObstacleAvoidanceDebugData();
|
||||||
@ -189,14 +189,14 @@ void dtObstacleAvoidanceDebugData::normalizeSamples()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dtObstacleAvoidanceQuery* rdAllocObstacleAvoidanceQuery()
|
dtObstacleAvoidanceQuery* dtAllocObstacleAvoidanceQuery()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtObstacleAvoidanceQuery), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtObstacleAvoidanceQuery), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtObstacleAvoidanceQuery;
|
return new(mem) dtObstacleAvoidanceQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr)
|
void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr)
|
||||||
{
|
{
|
||||||
if (!ptr) return;
|
if (!ptr) return;
|
||||||
ptr->~dtObstacleAvoidanceQuery();
|
ptr->~dtObstacleAvoidanceQuery();
|
||||||
|
@ -41,7 +41,7 @@ dtPathQueue::~dtPathQueue()
|
|||||||
|
|
||||||
void dtPathQueue::purge()
|
void dtPathQueue::purge()
|
||||||
{
|
{
|
||||||
rdFreeNavMeshQuery(m_navquery);
|
dtFreeNavMeshQuery(m_navquery);
|
||||||
m_navquery = 0;
|
m_navquery = 0;
|
||||||
for (int i = 0; i < MAX_QUEUE; ++i)
|
for (int i = 0; i < MAX_QUEUE; ++i)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ bool dtPathQueue::init(const int maxPathSize, const int maxSearchNodeCount, dtNa
|
|||||||
{
|
{
|
||||||
purge();
|
purge();
|
||||||
|
|
||||||
m_navquery = rdAllocNavMeshQuery();
|
m_navquery = dtAllocNavMeshQuery();
|
||||||
if (!m_navquery)
|
if (!m_navquery)
|
||||||
return false;
|
return false;
|
||||||
if (dtStatusFailed(m_navquery->init(nav, maxSearchNodeCount)))
|
if (dtStatusFailed(m_navquery->init(nav, maxSearchNodeCount)))
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
#include "Shared\Include\SharedAssert.h"
|
#include "Shared\Include\SharedAssert.h"
|
||||||
|
|
||||||
|
|
||||||
dtProximityGrid* rdAllocProximityGrid()
|
dtProximityGrid* dtAllocProximityGrid()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtProximityGrid), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtProximityGrid), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtProximityGrid;
|
return new(mem) dtProximityGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeProximityGrid(dtProximityGrid* ptr)
|
void dtFreeProximityGrid(dtProximityGrid* ptr)
|
||||||
{
|
{
|
||||||
if (!ptr) return;
|
if (!ptr) return;
|
||||||
ptr->~dtProximityGrid();
|
ptr->~dtProximityGrid();
|
||||||
|
@ -256,7 +256,7 @@ private:
|
|||||||
int m_nupdate;
|
int m_nupdate;
|
||||||
};
|
};
|
||||||
|
|
||||||
dtTileCache* rdAllocTileCache();
|
dtTileCache* dtAllocTileCache();
|
||||||
void rdFreeTileCache(dtTileCache* tc);
|
void dtFreeTileCache(dtTileCache* tc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -112,17 +112,17 @@ dtStatus dtBuildTileCacheLayer(dtTileCacheCompressor* comp,
|
|||||||
const unsigned char* cons,
|
const unsigned char* cons,
|
||||||
unsigned char** outData, int* outDataSize);
|
unsigned char** outData, int* outDataSize);
|
||||||
|
|
||||||
void rdFreeTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheLayer* layer);
|
void dtFreeTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheLayer* layer);
|
||||||
|
|
||||||
dtStatus dtDecompressTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheCompressor* comp,
|
dtStatus dtDecompressTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheCompressor* comp,
|
||||||
unsigned char* compressed, const int compressedSize,
|
unsigned char* compressed, const int compressedSize,
|
||||||
dtTileCacheLayer** layerOut);
|
dtTileCacheLayer** layerOut);
|
||||||
|
|
||||||
dtTileCacheContourSet* rdAllocTileCacheContourSet(dtTileCacheAlloc* alloc);
|
dtTileCacheContourSet* dtAllocTileCacheContourSet(dtTileCacheAlloc* alloc);
|
||||||
void rdFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* cset);
|
void dtFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* cset);
|
||||||
|
|
||||||
dtTileCachePolyMesh* rdAllocTileCachePolyMesh(dtTileCacheAlloc* alloc);
|
dtTileCachePolyMesh* dtAllocTileCachePolyMesh(dtTileCacheAlloc* alloc);
|
||||||
void rdFreeTileCachePolyMesh(dtTileCacheAlloc* alloc, dtTileCachePolyMesh* lmesh);
|
void dtFreeTileCachePolyMesh(dtTileCacheAlloc* alloc, dtTileCachePolyMesh* lmesh);
|
||||||
|
|
||||||
dtStatus dtMarkCylinderArea(dtTileCacheLayer& layer, const float* orig, const float cs, const float ch,
|
dtStatus dtMarkCylinderArea(dtTileCacheLayer& layer, const float* orig, const float cs, const float ch,
|
||||||
const float* pos, const float radius, const float height, const unsigned char areaId);
|
const float* pos, const float radius, const float height, const unsigned char areaId);
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
dtTileCache* rdAllocTileCache()
|
dtTileCache* dtAllocTileCache()
|
||||||
{
|
{
|
||||||
void* mem = rdAlloc(sizeof(dtTileCache), RD_ALLOC_PERM);
|
void* mem = rdAlloc(sizeof(dtTileCache), RD_ALLOC_PERM);
|
||||||
if (!mem) return 0;
|
if (!mem) return 0;
|
||||||
return new(mem) dtTileCache;
|
return new(mem) dtTileCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeTileCache(dtTileCache* tc)
|
void dtFreeTileCache(dtTileCache* tc)
|
||||||
{
|
{
|
||||||
if (!tc) return;
|
if (!tc) return;
|
||||||
tc->~dtTileCache();
|
tc->~dtTileCache();
|
||||||
@ -46,11 +46,11 @@ struct NavMeshTileBuildContext
|
|||||||
inline ~NavMeshTileBuildContext() { purge(); }
|
inline ~NavMeshTileBuildContext() { purge(); }
|
||||||
void purge()
|
void purge()
|
||||||
{
|
{
|
||||||
rdFreeTileCacheLayer(alloc, layer);
|
dtFreeTileCacheLayer(alloc, layer);
|
||||||
layer = 0;
|
layer = 0;
|
||||||
rdFreeTileCacheContourSet(alloc, lcset);
|
dtFreeTileCacheContourSet(alloc, lcset);
|
||||||
lcset = 0;
|
lcset = 0;
|
||||||
rdFreeTileCachePolyMesh(alloc, lmesh);
|
dtFreeTileCachePolyMesh(alloc, lmesh);
|
||||||
lmesh = 0;
|
lmesh = 0;
|
||||||
}
|
}
|
||||||
struct dtTileCacheLayer* layer;
|
struct dtTileCacheLayer* layer;
|
||||||
@ -701,7 +701,7 @@ dtStatus dtTileCache::buildNavMeshTile(const dtCompressedTileRef ref, dtNavMesh*
|
|||||||
if (dtStatusFailed(status))
|
if (dtStatusFailed(status))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
bc.lcset = rdAllocTileCacheContourSet(m_talloc);
|
bc.lcset = dtAllocTileCacheContourSet(m_talloc);
|
||||||
if (!bc.lcset)
|
if (!bc.lcset)
|
||||||
return DT_FAILURE | DT_OUT_OF_MEMORY;
|
return DT_FAILURE | DT_OUT_OF_MEMORY;
|
||||||
status = dtBuildTileCacheContours(m_talloc, *bc.layer, walkableClimbVx,
|
status = dtBuildTileCacheContours(m_talloc, *bc.layer, walkableClimbVx,
|
||||||
@ -709,7 +709,7 @@ dtStatus dtTileCache::buildNavMeshTile(const dtCompressedTileRef ref, dtNavMesh*
|
|||||||
if (dtStatusFailed(status))
|
if (dtStatusFailed(status))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
bc.lmesh = rdAllocTileCachePolyMesh(m_talloc);
|
bc.lmesh = dtAllocTileCachePolyMesh(m_talloc);
|
||||||
if (!bc.lmesh)
|
if (!bc.lmesh)
|
||||||
return DT_FAILURE | DT_OUT_OF_MEMORY;
|
return DT_FAILURE | DT_OUT_OF_MEMORY;
|
||||||
status = dtBuildTileCachePolyMesh(m_talloc, *bc.lcset, *bc.lmesh);
|
status = dtBuildTileCachePolyMesh(m_talloc, *bc.lcset, *bc.lmesh);
|
||||||
|
@ -54,7 +54,7 @@ static const int MAX_REM_EDGES = 48; // TODO: make this an expression.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
dtTileCacheContourSet* rdAllocTileCacheContourSet(dtTileCacheAlloc* alloc)
|
dtTileCacheContourSet* dtAllocTileCacheContourSet(dtTileCacheAlloc* alloc)
|
||||||
{
|
{
|
||||||
rdAssert(alloc);
|
rdAssert(alloc);
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ dtTileCacheContourSet* rdAllocTileCacheContourSet(dtTileCacheAlloc* alloc)
|
|||||||
return cset;
|
return cset;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* cset)
|
void dtFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* cset)
|
||||||
{
|
{
|
||||||
rdAssert(alloc);
|
rdAssert(alloc);
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ void rdFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* c
|
|||||||
alloc->free(cset);
|
alloc->free(cset);
|
||||||
}
|
}
|
||||||
|
|
||||||
dtTileCachePolyMesh* rdAllocTileCachePolyMesh(dtTileCacheAlloc* alloc)
|
dtTileCachePolyMesh* dtAllocTileCachePolyMesh(dtTileCacheAlloc* alloc)
|
||||||
{
|
{
|
||||||
rdAssert(alloc);
|
rdAssert(alloc);
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ dtTileCachePolyMesh* rdAllocTileCachePolyMesh(dtTileCacheAlloc* alloc)
|
|||||||
return lmesh;
|
return lmesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeTileCachePolyMesh(dtTileCacheAlloc* alloc, dtTileCachePolyMesh* lmesh)
|
void dtFreeTileCachePolyMesh(dtTileCacheAlloc* alloc, dtTileCachePolyMesh* lmesh)
|
||||||
{
|
{
|
||||||
rdAssert(alloc);
|
rdAssert(alloc);
|
||||||
|
|
||||||
@ -2145,7 +2145,7 @@ dtStatus dtBuildTileCacheLayer(dtTileCacheCompressor* comp,
|
|||||||
return DT_SUCCESS;
|
return DT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheLayer* layer)
|
void dtFreeTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheLayer* layer)
|
||||||
{
|
{
|
||||||
rdAssert(alloc);
|
rdAssert(alloc);
|
||||||
// The layer is allocated as one conitguous blob of data.
|
// The layer is allocated as one conitguous blob of data.
|
||||||
|
66
src/thirdparty/recast/Recast/Include/Recast.h
vendored
66
src/thirdparty/recast/Recast/Include/Recast.h
vendored
@ -399,7 +399,7 @@ struct rcHeightfieldLayer
|
|||||||
|
|
||||||
/// Represents a set of heightfield layers.
|
/// Represents a set of heightfield layers.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocHeightfieldLayerSet, rdFreeHeightfieldLayerSet
|
/// @see rcAllocHeightfieldLayerSet, rcFreeHeightfieldLayerSet
|
||||||
struct rcHeightfieldLayerSet
|
struct rcHeightfieldLayerSet
|
||||||
{
|
{
|
||||||
rcHeightfieldLayerSet();
|
rcHeightfieldLayerSet();
|
||||||
@ -506,74 +506,74 @@ private:
|
|||||||
/// Allocates a heightfield object using the Recast allocator.
|
/// Allocates a heightfield object using the Recast allocator.
|
||||||
/// @return A heightfield that is ready for initialization, or null on failure.
|
/// @return A heightfield that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcCreateHeightfield, rdFreeHeightField
|
/// @see rcCreateHeightfield, rcFreeHeightField
|
||||||
rcHeightfield* rdAllocHeightfield();
|
rcHeightfield* rcAllocHeightfield();
|
||||||
|
|
||||||
/// Frees the specified heightfield object using the Recast allocator.
|
/// Frees the specified heightfield object using the Recast allocator.
|
||||||
/// @param[in] heightfield A heightfield allocated using #rdAllocHeightfield
|
/// @param[in] heightfield A heightfield allocated using #rcAllocHeightfield
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocHeightfield
|
/// @see rcAllocHeightfield
|
||||||
void rdFreeHeightField(rcHeightfield* heightfield);
|
void rcFreeHeightField(rcHeightfield* heightfield);
|
||||||
|
|
||||||
/// Allocates a compact heightfield object using the Recast allocator.
|
/// Allocates a compact heightfield object using the Recast allocator.
|
||||||
/// @return A compact heightfield that is ready for initialization, or null on failure.
|
/// @return A compact heightfield that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcBuildCompactHeightfield, rdFreeCompactHeightfield
|
/// @see rcBuildCompactHeightfield, rcFreeCompactHeightfield
|
||||||
rcCompactHeightfield* rdAllocCompactHeightfield();
|
rcCompactHeightfield* rcAllocCompactHeightfield();
|
||||||
|
|
||||||
/// Frees the specified compact heightfield object using the Recast allocator.
|
/// Frees the specified compact heightfield object using the Recast allocator.
|
||||||
/// @param[in] compactHeightfield A compact heightfield allocated using #rdAllocCompactHeightfield
|
/// @param[in] compactHeightfield A compact heightfield allocated using #rcAllocCompactHeightfield
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocCompactHeightfield
|
/// @see rcAllocCompactHeightfield
|
||||||
void rdFreeCompactHeightfield(rcCompactHeightfield* compactHeightfield);
|
void rcFreeCompactHeightfield(rcCompactHeightfield* compactHeightfield);
|
||||||
|
|
||||||
/// Allocates a heightfield layer set using the Recast allocator.
|
/// Allocates a heightfield layer set using the Recast allocator.
|
||||||
/// @return A heightfield layer set that is ready for initialization, or null on failure.
|
/// @return A heightfield layer set that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcBuildHeightfieldLayers, rdFreeHeightfieldLayerSet
|
/// @see rcBuildHeightfieldLayers, rcFreeHeightfieldLayerSet
|
||||||
rcHeightfieldLayerSet* rdAllocHeightfieldLayerSet();
|
rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet();
|
||||||
|
|
||||||
/// Frees the specified heightfield layer set using the Recast allocator.
|
/// Frees the specified heightfield layer set using the Recast allocator.
|
||||||
/// @param[in] layerSet A heightfield layer set allocated using #rdAllocHeightfieldLayerSet
|
/// @param[in] layerSet A heightfield layer set allocated using #rcAllocHeightfieldLayerSet
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocHeightfieldLayerSet
|
/// @see rcAllocHeightfieldLayerSet
|
||||||
void rdFreeHeightfieldLayerSet(rcHeightfieldLayerSet* layerSet);
|
void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* layerSet);
|
||||||
|
|
||||||
/// Allocates a contour set object using the Recast allocator.
|
/// Allocates a contour set object using the Recast allocator.
|
||||||
/// @return A contour set that is ready for initialization, or null on failure.
|
/// @return A contour set that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcBuildContours, rdFreeContourSet
|
/// @see rcBuildContours, rcFreeContourSet
|
||||||
rcContourSet* rdAllocContourSet();
|
rcContourSet* rcAllocContourSet();
|
||||||
|
|
||||||
/// Frees the specified contour set using the Recast allocator.
|
/// Frees the specified contour set using the Recast allocator.
|
||||||
/// @param[in] contourSet A contour set allocated using #rdAllocContourSet
|
/// @param[in] contourSet A contour set allocated using #rcAllocContourSet
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocContourSet
|
/// @see rcAllocContourSet
|
||||||
void rdFreeContourSet(rcContourSet* contourSet);
|
void rcFreeContourSet(rcContourSet* contourSet);
|
||||||
|
|
||||||
/// Allocates a polygon mesh object using the Recast allocator.
|
/// Allocates a polygon mesh object using the Recast allocator.
|
||||||
/// @return A polygon mesh that is ready for initialization, or null on failure.
|
/// @return A polygon mesh that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcBuildPolyMesh, rdFreePolyMesh
|
/// @see rcBuildPolyMesh, rcFreePolyMesh
|
||||||
rcPolyMesh* rdAllocPolyMesh();
|
rcPolyMesh* rcAllocPolyMesh();
|
||||||
|
|
||||||
/// Frees the specified polygon mesh using the Recast allocator.
|
/// Frees the specified polygon mesh using the Recast allocator.
|
||||||
/// @param[in] polyMesh A polygon mesh allocated using #rdAllocPolyMesh
|
/// @param[in] polyMesh A polygon mesh allocated using #rcAllocPolyMesh
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocPolyMesh
|
/// @see rcAllocPolyMesh
|
||||||
void rdFreePolyMesh(rcPolyMesh* polyMesh);
|
void rcFreePolyMesh(rcPolyMesh* polyMesh);
|
||||||
|
|
||||||
/// Allocates a detail mesh object using the Recast allocator.
|
/// Allocates a detail mesh object using the Recast allocator.
|
||||||
/// @return A detail mesh that is ready for initialization, or null on failure.
|
/// @return A detail mesh that is ready for initialization, or null on failure.
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rcBuildPolyMeshDetail, rdFreePolyMeshDetail
|
/// @see rcBuildPolyMeshDetail, rcFreePolyMeshDetail
|
||||||
rcPolyMeshDetail* rdAllocPolyMeshDetail();
|
rcPolyMeshDetail* rcAllocPolyMeshDetail();
|
||||||
|
|
||||||
/// Frees the specified detail mesh using the Recast allocator.
|
/// Frees the specified detail mesh using the Recast allocator.
|
||||||
/// @param[in] detailMesh A detail mesh allocated using #rdAllocPolyMeshDetail
|
/// @param[in] detailMesh A detail mesh allocated using #rcAllocPolyMeshDetail
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
/// @see rdAllocPolyMeshDetail
|
/// @see rcAllocPolyMeshDetail
|
||||||
void rdFreePolyMeshDetail(rcPolyMeshDetail* detailMesh);
|
void rcFreePolyMeshDetail(rcPolyMeshDetail* detailMesh);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
@ -843,7 +843,7 @@ void rcCalcGridSize(const float* minBounds, const float* maxBounds, float cellSi
|
|||||||
/// Initializes a new heightfield.
|
/// Initializes a new heightfield.
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
/// @see rdAllocHeightfield, rcHeightfield
|
/// @see rcAllocHeightfield, rcHeightfield
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
///
|
///
|
||||||
/// @param[in,out] context The build context to use during the operation.
|
/// @param[in,out] context The build context to use during the operation.
|
||||||
@ -1081,7 +1081,7 @@ int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfie
|
|||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
/// @see rdAllocCompactHeightfield, rcHeightfield, rcCompactHeightfield, rcConfig
|
/// @see rcAllocCompactHeightfield, rcHeightfield, rcCompactHeightfield, rcConfig
|
||||||
/// @ingroup recast
|
/// @ingroup recast
|
||||||
///
|
///
|
||||||
/// @param[in,out] context The build context to use during the operation.
|
/// @param[in,out] context The build context to use during the operation.
|
||||||
|
24
src/thirdparty/recast/Recast/Source/Recast.cpp
vendored
24
src/thirdparty/recast/Recast/Source/Recast.cpp
vendored
@ -83,12 +83,12 @@ void rcContext::doResetLog()
|
|||||||
// Defined out of line to fix the weak v-tables warning
|
// Defined out of line to fix the weak v-tables warning
|
||||||
}
|
}
|
||||||
|
|
||||||
rcHeightfield* rdAllocHeightfield()
|
rcHeightfield* rcAllocHeightfield()
|
||||||
{
|
{
|
||||||
return rcNew<rcHeightfield>(RD_ALLOC_PERM);
|
return rcNew<rcHeightfield>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeHeightField(rcHeightfield* heightfield)
|
void rcFreeHeightField(rcHeightfield* heightfield)
|
||||||
{
|
{
|
||||||
rcDelete(heightfield);
|
rcDelete(heightfield);
|
||||||
}
|
}
|
||||||
@ -119,12 +119,12 @@ rcHeightfield::~rcHeightfield()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rcCompactHeightfield* rdAllocCompactHeightfield()
|
rcCompactHeightfield* rcAllocCompactHeightfield()
|
||||||
{
|
{
|
||||||
return rcNew<rcCompactHeightfield>(RD_ALLOC_PERM);
|
return rcNew<rcCompactHeightfield>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeCompactHeightfield(rcCompactHeightfield* compactHeightfield)
|
void rcFreeCompactHeightfield(rcCompactHeightfield* compactHeightfield)
|
||||||
{
|
{
|
||||||
rcDelete(compactHeightfield);
|
rcDelete(compactHeightfield);
|
||||||
}
|
}
|
||||||
@ -157,12 +157,12 @@ rcCompactHeightfield::~rcCompactHeightfield()
|
|||||||
rdFree(areas);
|
rdFree(areas);
|
||||||
}
|
}
|
||||||
|
|
||||||
rcHeightfieldLayerSet* rdAllocHeightfieldLayerSet()
|
rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet()
|
||||||
{
|
{
|
||||||
return rcNew<rcHeightfieldLayerSet>(RD_ALLOC_PERM);
|
return rcNew<rcHeightfieldLayerSet>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeHeightfieldLayerSet(rcHeightfieldLayerSet* layerSet)
|
void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* layerSet)
|
||||||
{
|
{
|
||||||
rcDelete(layerSet);
|
rcDelete(layerSet);
|
||||||
}
|
}
|
||||||
@ -185,12 +185,12 @@ rcHeightfieldLayerSet::~rcHeightfieldLayerSet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rcContourSet* rdAllocContourSet()
|
rcContourSet* rcAllocContourSet()
|
||||||
{
|
{
|
||||||
return rcNew<rcContourSet>(RD_ALLOC_PERM);
|
return rcNew<rcContourSet>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreeContourSet(rcContourSet* contourSet)
|
void rcFreeContourSet(rcContourSet* contourSet)
|
||||||
{
|
{
|
||||||
rcDelete(contourSet);
|
rcDelete(contourSet);
|
||||||
}
|
}
|
||||||
@ -219,12 +219,12 @@ rcContourSet::~rcContourSet()
|
|||||||
rdFree(conts);
|
rdFree(conts);
|
||||||
}
|
}
|
||||||
|
|
||||||
rcPolyMesh* rdAllocPolyMesh()
|
rcPolyMesh* rcAllocPolyMesh()
|
||||||
{
|
{
|
||||||
return rcNew<rcPolyMesh>(RD_ALLOC_PERM);
|
return rcNew<rcPolyMesh>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreePolyMesh(rcPolyMesh* polyMesh)
|
void rcFreePolyMesh(rcPolyMesh* polyMesh)
|
||||||
{
|
{
|
||||||
rcDelete(polyMesh);
|
rcDelete(polyMesh);
|
||||||
}
|
}
|
||||||
@ -257,12 +257,12 @@ rcPolyMesh::~rcPolyMesh()
|
|||||||
rdFree(areas);
|
rdFree(areas);
|
||||||
}
|
}
|
||||||
|
|
||||||
rcPolyMeshDetail* rdAllocPolyMeshDetail()
|
rcPolyMeshDetail* rcAllocPolyMeshDetail()
|
||||||
{
|
{
|
||||||
return rcNew<rcPolyMeshDetail>(RD_ALLOC_PERM);
|
return rcNew<rcPolyMeshDetail>(RD_ALLOC_PERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdFreePolyMeshDetail(rcPolyMeshDetail* detailMesh)
|
void rcFreePolyMeshDetail(rcPolyMeshDetail* detailMesh)
|
||||||
{
|
{
|
||||||
if (detailMesh == NULL)
|
if (detailMesh == NULL)
|
||||||
{
|
{
|
||||||
|
@ -819,7 +819,7 @@ static void mergeRegionHoles(rcContext* ctx, rcContourRegion& region)
|
|||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
/// @see rdAllocContourSet, rcCompactHeightfield, rcContourSet, rcConfig
|
/// @see rcAllocContourSet, rcCompactHeightfield, rcContourSet, rcConfig
|
||||||
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
|
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
|
||||||
const float maxError, const int maxEdgeLen,
|
const float maxError, const int maxEdgeLen,
|
||||||
rcContourSet& cset, const int buildFlags)
|
rcContourSet& cset, const int buildFlags)
|
||||||
|
@ -88,7 +88,7 @@ struct rcLayerSweepSpan
|
|||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
/// @see rdAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig
|
/// @see rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig
|
||||||
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||||
const int borderSize, const int walkableHeight,
|
const int borderSize, const int walkableHeight,
|
||||||
rcHeightfieldLayerSet& lset)
|
rcHeightfieldLayerSet& lset)
|
||||||
|
@ -1050,7 +1050,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short
|
|||||||
/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
|
/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
|
||||||
/// limit must be restricted to <= #DT_VERTS_PER_POLYGON.
|
/// limit must be restricted to <= #DT_VERTS_PER_POLYGON.
|
||||||
///
|
///
|
||||||
/// @see rdAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
|
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
|
||||||
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
|
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
|
||||||
{
|
{
|
||||||
rdAssert(ctx);
|
rdAssert(ctx);
|
||||||
@ -1380,7 +1380,7 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @see rdAllocPolyMesh, rcPolyMesh
|
/// @see rcAllocPolyMesh, rcPolyMesh
|
||||||
bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
|
bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
|
||||||
{
|
{
|
||||||
rdAssert(ctx);
|
rdAssert(ctx);
|
||||||
|
@ -1284,7 +1284,7 @@ static void getHeightData(rcContext* ctx, const rcCompactHeightfield& chf,
|
|||||||
///
|
///
|
||||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||||
///
|
///
|
||||||
/// @see rdAllocPolyMeshDetail, rcPolyMesh, rcCompactHeightfield, rcPolyMeshDetail, rcConfig
|
/// @see rcAllocPolyMeshDetail, rcPolyMesh, rcCompactHeightfield, rcPolyMeshDetail, rcConfig
|
||||||
bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
|
bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
|
||||||
const float sampleDist, const float sampleMaxError,
|
const float sampleDist, const float sampleMaxError,
|
||||||
rcPolyMeshDetail& dmesh)
|
rcPolyMeshDetail& dmesh)
|
||||||
@ -1504,7 +1504,7 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @see rdAllocPolyMeshDetail, rcPolyMeshDetail
|
/// @see rcAllocPolyMeshDetail, rcPolyMeshDetail
|
||||||
bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh)
|
bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh)
|
||||||
{
|
{
|
||||||
rdAssert(ctx);
|
rdAssert(ctx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user