本文整理汇总了C++中dtFreeNavMesh函数的典型用法代码示例。如果您正苦于以下问题:C++ dtFreeNavMesh函数的具体用法?C++ dtFreeNavMesh怎么用?C++ dtFreeNavMesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dtFreeNavMesh函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BotShutdownNav
void BotShutdownNav( void )
{
for ( int i = 0; i < numNavData; i++ )
{
NavData_t *nav = &BotNavData[ i ];
if ( nav->cache )
{
dtFreeTileCache( nav->cache );
nav->cache = 0;
}
if ( nav->mesh )
{
dtFreeNavMesh( nav->mesh );
nav->mesh = 0;
}
if ( nav->query )
{
dtFreeNavMeshQuery( nav->query );
nav->query = 0;
}
nav->process.con.reset();
memset( nav->name, 0, sizeof( nav->name ) );
}
#ifndef DEDICATED
NavEditShutdown();
#endif
numNavData = 0;
}
开发者ID:Gireen,项目名称:Unvanquished,代码行数:33,代码来源:bot_load.cpp
示例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;
}
}
开发者ID:arrian,项目名称:3d-engine,代码行数:29,代码来源:OgreRecast.cpp
示例3: imguiSeparator
void Sample_SoloMesh::handleSettings()
{
Sample::handleCommonSettings();
if (imguiCheck("Keep Itermediate Results", m_keepInterResults))
m_keepInterResults = !m_keepInterResults;
imguiSeparator();
imguiIndent();
imguiIndent();
if (imguiButton("Save"))
{
Sample::saveAll("solo_navmesh.bin", m_navMesh);
}
if (imguiButton("Load"))
{
dtFreeNavMesh(m_navMesh);
m_navMesh = Sample::loadAll("solo_navmesh.bin");
m_navQuery->init(m_navMesh, 2048);
}
imguiUnindent();
imguiUnindent();
char msg[64];
snprintf(msg, 64, "Build Time: %.1fms", m_totalBuildTimeMs);
imguiLabel(msg);
imguiSeparator();
}
开发者ID:ArtStealer,项目名称:recastnavigation,代码行数:33,代码来源:Sample_SoloMesh.cpp
示例4: dtnmFreeNavMesh
EXPORT_API void dtnmFreeNavMesh(dtNavMesh** pNavMesh, bool freeTiles)
{
if (!pNavMesh && !(*pNavMesh))
return;
dtNavMesh* mesh = *pNavMesh;
const dtNavMesh* cmesh = *pNavMesh; // Cleaner code when calling getTile().
if (freeTiles)
{
unsigned char* tData = 0;
for (int i = 0; i < mesh->getMaxTiles(); ++i)
{
const dtMeshTile* tile = cmesh->getTile(i);
if (!tile || !tile->header || !tile->dataSize)
continue;
dtTileRef tref = mesh->getTileRef(tile);
dtStatus status = mesh->removeTile(tref, &tData, 0);
if (dtStatusSucceed(status) && tData)
{
dtFree(tData);
tData = 0;
}
}
}
dtFreeNavMesh(mesh);
}
开发者ID:AllenWangxiao,项目名称:critterai,代码行数:33,代码来源:DetourNavMeshBuildEx.cpp
示例5: dtnmBuildSingleTileMesh
EXPORT_API dtStatus dtnmBuildSingleTileMesh(dtNavMeshCreateParams* params
, dtNavMesh** ppNavMesh)
{
if (!params)
return DT_FAILURE + DT_INVALID_PARAM;
unsigned char* navData = 0;
int navDataSize = 0;
if (!dtCreateNavMeshData(params, &navData, &navDataSize))
return DT_FAILURE + DT_INVALID_PARAM;
dtNavMesh* pNavMesh = dtAllocNavMesh();
if (!pNavMesh)
{
dtFree(navData);
return DT_FAILURE + DT_OUT_OF_MEMORY;
}
dtStatus status =
pNavMesh->init(navData, navDataSize, DT_TILE_FREE_DATA);
if (dtStatusFailed(status))
{
dtFreeNavMesh(pNavMesh);
dtFree(navData);
return status;
}
*ppNavMesh = pNavMesh;
return DT_SUCCESS;
}
开发者ID:AllenWangxiao,项目名称:critterai,代码行数:33,代码来源:DetourNavMeshBuildEx.cpp
示例6: generateMesh
bool NavMesh::buildProcess()
{
mBuilding = true;
// Create mesh
bool success = generateMesh();
mNavMeshLock.lock();
// Copy new navmesh into old.
dtNavMesh *old = nm;
nm = tnm; // I am trusting that this is atomic.
dtFreeNavMesh(old);
tnm = NULL;
mNavMeshLock.unlock();
// Free structs used during build
freeIntermediates(false);
// Alert event manager that we have been built.
if(mEventManager)
mEventManager->postEvent("NavMeshBuild", "");
mBuilding = false;
return success;
}
开发者ID:belzilep,项目名称:Torque3D,代码行数:26,代码来源:navMesh.cpp
示例7: dtFreeNavMeshQuery
Sample::~Sample()
{
dtFreeNavMeshQuery(m_navQuery);
dtFreeNavMesh(m_navMesh);
dtFreeCrowd(m_crowd);
delete m_tool;
}
开发者ID:Bootz,项目名称:WCell,代码行数:7,代码来源:Sample.cpp
示例8: dtFreeNavMesh
void DetourInterface::detourCleanup()
{
dtFreeNavMesh(_navMesh);
_navMesh = 0;
dtFreeNavMeshQuery(_navQuery);
_navQuery = 0;
}
开发者ID:Dar13,项目名称:WastelandArchive,代码行数:8,代码来源:DetourInterface.cpp
示例9: cleanup
NavMeshGenerator::~NavMeshGenerator()
{
cleanup();
dtFreeNavMeshQuery(m_navQuery);
dtFreeNavMesh(m_navMesh);
dtFreeCrowd(m_crowd);
}
开发者ID:vincent-grosbois,项目名称:sfml_test,代码行数:8,代码来源:NavMeshGenerator.cpp
示例10: dtFreeNavMesh
void SoloMesh::handleMeshChanged(InputGeom* geom)
{
// m_geom = geom;
Sample::handleMeshChanged(geom);
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
}
开发者ID:Glidias,项目名称:RecastAS3,代码行数:8,代码来源:SoloMesh.cpp
示例11: dtFreeNavMeshQuery
Sample::~Sample()
{
dtFreeNavMeshQuery(m_navQuery);
dtFreeNavMesh(m_navMesh);
dtFreeCrowd(m_crowd);
delete m_tool;
for (int i = 0; i < MAX_TOOLS; i++)
delete m_toolStates[i];
}
开发者ID:Zedron,项目名称:recastnavigation,代码行数:9,代码来源:Sample.cpp
示例12: dtFreeTileCache
void NavMesh::SetMesh(InputGeom* geom)
{
m_geom = geom;
dtFreeTileCache(m_tileCache);
m_tileCache = 0;
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
}
开发者ID:ngoaho91,项目名称:bamboocc,代码行数:9,代码来源:PathEngine.cpp
示例13: dtFreeTileCache
bool OgreDetourTileCache::initTileCache()
{
// BUILD TileCache
dtFreeTileCache(m_tileCache);
dtStatus status;
m_tileCache = dtAllocTileCache();
if (!m_tileCache)
{
m_recast->m_pLog->logMessage("ERROR: buildTiledNavigation: Could not allocate tile cache.");
return false;
}
status = m_tileCache->init(&m_tcparams, m_talloc, m_tcomp, m_tmproc);
if (dtStatusFailed(status))
{
m_recast->m_pLog->logMessage("ERROR: buildTiledNavigation: Could not init tile cache.");
return false;
}
dtFreeNavMesh(m_recast->m_navMesh);
m_recast->m_navMesh = dtAllocNavMesh();
if (!m_recast->m_navMesh)
{
m_recast->m_pLog->logMessage("ERROR: buildTiledNavigation: Could not allocate navmesh.");
return false;
}
// Init multi-tile navmesh parameters
dtNavMeshParams params;
memset(¶ms, 0, sizeof(params));
rcVcopy(params.orig, m_tcparams.orig); // Set world-space origin of tile grid
params.tileWidth = m_tileSize*m_tcparams.cs;
params.tileHeight = m_tileSize*m_tcparams.cs;
params.maxTiles = m_maxTiles;
params.maxPolys = m_maxPolysPerTile;
status = m_recast->m_navMesh->init(¶ms);
if (dtStatusFailed(status))
{
m_recast->m_pLog->logMessage("ERROR: buildTiledNavigation: Could not init navmesh.");
return false;
}
// Init recast navmeshquery with created navmesh (in OgreRecast component)
m_recast->m_navQuery = dtAllocNavMeshQuery();
status = m_recast->m_navQuery->init(m_recast->m_navMesh, 2048);
if (dtStatusFailed(status))
{
m_recast->m_pLog->logMessage("ERROR: buildTiledNavigation: Could not init Detour navmesh query");
return false;
}
return true;
}
开发者ID:Unix4ever,项目名称:engine,代码行数:57,代码来源:OgreDetourTileCache.cpp
示例14: dtFreeNavMesh
NavMeshLoader::~NavMeshLoader() {
if (m_navMesh)
{
dtFreeNavMesh(m_navMesh);
}
if (m_navQuery)
{
dtFreeNavMeshQuery(m_navQuery);
}
}
开发者ID:lovemychobits,项目名称:game_server,代码行数:10,代码来源:SceneMng.cpp
示例15: dtFreeNavMesh
//-------------------------------------------------------------------------------------
NavMeshHandle::~NavMeshHandle()
{
std::map<int, NavmeshLayer>::iterator iter = navmeshLayer.begin();
for(; iter != navmeshLayer.end(); ++iter)
{
dtFreeNavMesh(iter->second.pNavmesh);
dtFreeNavMeshQuery(iter->second.pNavmeshQuery);
}
DEBUG_MSG(fmt::format("NavMeshHandle::~NavMeshHandle(): ({}) is destroyed!\n", resPath));
}
开发者ID:AlbertGithubHome,项目名称:kbengine,代码行数:12,代码来源:navigation_mesh_handle.cpp
示例16: dtFreeNavMesh
//-------------------------------------------------------------------------------------
NavMeshHandle::~NavMeshHandle()
{
std::vector<dtNavMesh*>::iterator iter = navmesh_layers.begin();
for(; iter != navmesh_layers.end(); iter++)
dtFreeNavMesh((*iter));
std::vector<dtNavMeshQuery*>::iterator iter1 = navmeshQuery_layers.begin();
for(; iter1 != navmeshQuery_layers.end(); iter1++)
dtFreeNavMeshQuery((*iter1));
DEBUG_MSG(fmt::format("NavMeshHandle::~NavMeshHandle(): ({}) is destroyed!\n", name));
}
开发者ID:JonathanCai,项目名称:kbengine,代码行数:13,代码来源:navigation_mesh_handle.cpp
示例17: getTileList
void MapBuilder::buildMap(uint32 mapID)
{
#ifndef __APPLE__
//printf("[Thread %u] Building map %03u:\n", uint32(ACE_Thread::self()), mapID);
#endif
std::set<uint32>* tiles = getTileList(mapID);
// make sure we process maps which don't have tiles
if (!tiles->size())
{
// convert coord bounds to grid bounds
uint32 minX, minY, maxX, maxY;
getGridBounds(mapID, minX, minY, maxX, maxY);
// add all tiles within bounds to tile list.
for (uint32 i = minX; i <= maxX; ++i)
for (uint32 j = minY; j <= maxY; ++j)
tiles->insert(StaticMapTree::packTileID(i, j));
}
if (!tiles->empty())
{
// build navMesh
dtNavMesh* navMesh = NULL;
buildNavMesh(mapID, navMesh);
if (!navMesh)
{
printf("[Map %04i] Failed creating navmesh!\n", mapID);
return;
}
// now start building mmtiles for each tile
printf("[Map %04i] We have %u tiles. \n", mapID, (unsigned int)tiles->size());
for (std::set<uint32>::iterator it = tiles->begin(); it != tiles->end(); ++it)
{
uint32 tileX, tileY;
// unpack tile coords
StaticMapTree::unpackTileID((*it), tileX, tileY);
if (shouldSkipTile(mapID, tileX, tileY))
continue;
buildTile(mapID, tileX, tileY, navMesh);
}
dtFreeNavMesh(navMesh);
}
printf("[Map %04u] Complete!\n", mapID);
}
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:52,代码来源:MapBuilder.cpp
示例18: dtFreeNavMesh
void NavigationMesh::ReleaseNavigationMesh()
{
dtFreeNavMesh(navMesh_);
navMesh_ = 0;
dtFreeNavMeshQuery(navMeshQuery_);
navMeshQuery_ = 0;
numTilesX_ = 0;
numTilesZ_ = 0;
boundingBox_.min_ = boundingBox_.max_ = Vector3::ZERO;
boundingBox_.defined_ = false;
}
开发者ID:SkunkWorks99,项目名称:Urho3D,代码行数:13,代码来源:NavigationMesh.cpp
示例19: dtFreeNavMesh
void Sample_SoloMesh::handleMeshChanged(class InputGeom* geom)
{
Sample::handleMeshChanged(geom);
dtFreeNavMesh(m_navMesh);
m_navMesh = 0;
if (m_tool)
{
m_tool->reset();
m_tool->init(this);
}
}
开发者ID:120pulsations,项目名称:SDK,代码行数:13,代码来源:Sample_SoloMesh.cpp
示例20: buildNavMesh
void MapBuilder::buildSingleTile(uint32 mapID, uint32 tileX, uint32 tileY)
{
dtNavMesh* navMesh = NULL;
buildNavMesh(mapID, navMesh);
if (!navMesh)
{
printf("Failed creating navmesh! \n");
return;
}
buildTile(mapID, tileX, tileY, navMesh);
dtFreeNavMesh(navMesh);
}
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:13,代码来源:MapBuilder.cpp
注:本文中的dtFreeNavMesh函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论