本文整理汇总了C++中rcFreeContourSet函数的典型用法代码示例。如果您正苦于以下问题:C++ rcFreeContourSet函数的具体用法?C++ rcFreeContourSet怎么用?C++ rcFreeContourSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rcFreeContourSet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rcFreeHeightField
void RecastInterface::recastClean()
{
if(_triangleAreas)
{
delete[] _triangleAreas;
_triangleAreas = nullptr;
}
rcFreeHeightField(_solid);
_solid = nullptr;
rcFreeCompactHeightfield(_compactHeightfield);
_compactHeightfield = nullptr;
rcFreeContourSet(_contourSet);
_contourSet = nullptr;
rcFreePolyMesh(_polyMesh);
_polyMesh = nullptr;
rcFreePolyMeshDetail(_detailMesh);
_detailMesh = nullptr;
if(_context)
{
delete _context;
_context = nullptr;
}
}
示例2: rcFreeHeightField
/**
* Cleanup recast stuff, not debug manualobjects.
**/
void OgreRecast::RecastCleanup()
{
if(m_triareas) delete [] m_triareas;
m_triareas = 0;
rcFreeHeightField(m_solid);
m_solid = 0;
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
rcFreePolyMesh(m_pmesh);
m_pmesh = 0;
rcFreePolyMeshDetail(m_dmesh);
m_dmesh = 0;
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
dtFreeNavMeshQuery(m_navQuery);
m_navQuery = 0 ;
if(m_ctx){
delete m_ctx;
m_ctx = 0;
}
}
示例3: rcFreeCompactHeightfield
IntermediateValues::~IntermediateValues()
{
rcFreeCompactHeightfield(compactHeightfield);
rcFreeHeightField(heightfield);
rcFreeContourSet(contours);
rcFreePolyMesh(polyMesh);
rcFreePolyMeshDetail(polyMeshDetail);
}
示例4: rcFreeContourSet
SimpleNavBuildData::~SimpleNavBuildData()
{
rcFreeContourSet(contourSet_);
contourSet_ = nullptr;
rcFreePolyMesh(polyMesh_);
polyMesh_ = nullptr;
rcFreePolyMeshDetail(polyMeshDetail_);
polyMeshDetail_ = nullptr;
}
示例5: rcFreeHeightField
void RecastTileBuilder::cleanup() {
delete[] m_triareas;
m_triareas = 0;
rcFreeHeightField(m_solid);
m_solid = 0;
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
rcFreePolyMesh(m_pmesh);
m_pmesh = 0;
rcFreePolyMeshDetail(m_dmesh);
m_dmesh = 0;
}
示例6: rcFreeHeightField
void Sample_TileMesh::cleanup()
{
delete [] m_triareaMasks;
m_triareaMasks = 0;
rcFreeHeightField(m_solid);
m_solid = 0;
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
rcFreePolyMesh(m_pmesh);
m_pmesh = 0;
rcFreePolyMeshDetail(m_dmesh);
m_dmesh = 0;
}
示例7: rcFreeHeightField
void NavMeshGenerator::cleanup()
{
rcFreeHeightField(m_solid);
m_solid = 0;
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
rcFreePolyMesh(m_pmesh);
m_pmesh = 0;
rcFreePolyMeshDetail(m_dmesh);
m_dmesh = 0;
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
}
示例8: rcFreeContourSet
void NavMeshCreator::freeIntermediateResults()
{
rcFreeContourSet(m_intermediateContourSet);
m_intermediateContourSet = 0;
rcFreePolyMesh(m_intermediatePolyMesh);
m_intermediatePolyMesh = 0;
rcFreeHeightField(m_intermediateHeightfield);
m_intermediateHeightfield = 0;
rcFreeCompactHeightfield(m_intermediateCompactHeightfield);
m_intermediateCompactHeightfield = 0;
rcFreePolyMeshDetail(m_intermediatePolyMeshDetail);
m_intermediatePolyMeshDetail = 0;
}
示例9: rcFreeHeightField
void Sample_SoloMeshSimple::cleanup()
{
delete [] m_triareas;
m_triareas = 0;
rcFreeHeightField(m_solid);
m_solid = 0;
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
rcFreePolyMesh(m_pmesh);
m_pmesh = 0;
rcFreePolyMeshDetail(m_dmesh);
m_dmesh = 0;
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
}
示例10: rcFreeHeightField
void NavMesh::freeIntermediates(bool freeAll)
{
mNavMeshLock.lock();
rcFreeHeightField(hf); hf = NULL;
rcFreeCompactHeightfield(chf); chf = NULL;
if(!mSaveIntermediates || freeAll)
{
rcFreeContourSet(cs); cs = NULL;
rcFreePolyMesh(pm); pm = NULL;
rcFreePolyMeshDetail(pmd); pmd = NULL;
delete mInPolys;
mInPolys = NULL;
}
mNavMeshLock.unlock();
}
示例11: rcFreeContourSet
bool Sample_Debug::handleBuild()
{
if (m_chf)
{
rcFreeContourSet(m_cset);
m_cset = 0;
// Create contours.
m_cset = rcAllocContourSet();
if (!m_cset)
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'.");
return false;
}
if (!rcBuildContours(m_ctx, *m_chf, /*m_cfg.maxSimplificationError*/1.3f, /*m_cfg.maxEdgeLen*/12, *m_cset))
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not create contours.");
return false;
}
}
return true;
}
示例12: printf
//.........这里部分代码省略.........
printf("%s Failed building regions! \n", tileString.c_str());
continue;
}
tile.cset = rcAllocContourSet();
if (!tile.cset || !rcBuildContours(m_rcContext, *tile.chf, tileCfg.maxSimplificationError, tileCfg.maxEdgeLen, *tile.cset))
{
printf("%s Failed building contours! \n", tileString.c_str());
continue;
}
// build polymesh
tile.pmesh = rcAllocPolyMesh();
if (!tile.pmesh || !rcBuildPolyMesh(m_rcContext, *tile.cset, tileCfg.maxVertsPerPoly, *tile.pmesh))
{
printf("%s Failed building polymesh! \n", tileString.c_str());
continue;
}
tile.dmesh = rcAllocPolyMeshDetail();
if (!tile.dmesh || !rcBuildPolyMeshDetail(m_rcContext, *tile.pmesh, *tile.chf, tileCfg.detailSampleDist, tileCfg.detailSampleMaxError, *tile.dmesh))
{
printf("%s Failed building polymesh detail! \n", tileString.c_str());
continue;
}
// free those up
// we may want to keep them in the future for debug
// but right now, we don't have the code to merge them
rcFreeHeightField(tile.solid);
tile.solid = NULL;
rcFreeCompactHeightfield(tile.chf);
tile.chf = NULL;
rcFreeContourSet(tile.cset);
tile.cset = NULL;
pmmerge[nmerge] = tile.pmesh;
dmmerge[nmerge] = tile.dmesh;
nmerge++;
}
}
iv.polyMesh = rcAllocPolyMesh();
if (!iv.polyMesh)
{
printf("%s alloc iv.polyMesh FAILED!\n", tileString.c_str());
delete[] pmmerge;
delete[] dmmerge;
delete[] tiles;
return;
}
rcMergePolyMeshes(m_rcContext, pmmerge, nmerge, *iv.polyMesh);
iv.polyMeshDetail = rcAllocPolyMeshDetail();
if (!iv.polyMeshDetail)
{
printf("%s alloc m_dmesh FAILED!\n", tileString.c_str());
delete[] pmmerge;
delete[] dmmerge;
delete[] tiles;
return;
}
rcMergePolyMeshDetails(m_rcContext, dmmerge, nmerge, *iv.polyMeshDetail);
// free things up
delete[] pmmerge;
示例13: rcFreeCompactHeightfield
Sample_Debug::~Sample_Debug()
{
rcFreeCompactHeightfield(m_chf);
rcFreeContourSet(m_cset);
rcFreePolyMesh(m_pmesh);
}
示例14: cleanup
//.........这里部分代码省略.........
// Build polygon navmesh from the contours.
m_pmesh = rcAllocPolyMesh();
if (!m_pmesh)
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'.");
return 0;
}
if (!rcBuildPolyMesh(m_ctx, *m_cset, m_cfg.maxVertsPerPoly, *m_pmesh))
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not triangulate contours.");
return 0;
}
// Build detail mesh.
m_dmesh = rcAllocPolyMeshDetail();
if (!m_dmesh)
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'.");
return 0;
}
if (!rcBuildPolyMeshDetail(m_ctx, *m_pmesh, *m_chf,
m_cfg.detailSampleDist, m_cfg.detailSampleMaxError,
*m_dmesh))
{
m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could build polymesh detail.");
return 0;
}
if (!m_keepInterResults)
{
rcFreeCompactHeightfield(m_chf);
m_chf = 0;
rcFreeContourSet(m_cset);
m_cset = 0;
}
unsigned char* navData = 0;
int navDataSize = 0;
if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON)
{
if (m_pmesh->nverts >= 0xffff)
{
// The vertex indices are ushorts, and cannot point to more than 0xffff vertices.
m_ctx->log(RC_LOG_ERROR, "Too many vertices per tile %d (max: %d).", m_pmesh->nverts, 0xffff);
return 0;
}
// Update poly flags from areas.
for (int i = 0; i < m_pmesh->npolys; ++i)
{
if (m_pmesh->areas[i] == RC_WALKABLE_AREA)
m_pmesh->areas[i] = SAMPLE_POLYAREA_GROUND;
if (m_pmesh->areas[i] == SAMPLE_POLYAREA_GROUND ||
m_pmesh->areas[i] == SAMPLE_POLYAREA_GRASS ||
m_pmesh->areas[i] == SAMPLE_POLYAREA_ROAD)
{
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK;
}
else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_WATER)
{
m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SWIM;
}
else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_DOOR)
{
示例15: recast_destroyContourSet
void recast_destroyContourSet(struct recast_contourSet *contourSet)
{
rcFreeContourSet((rcContourSet *) contourSet);
}