Ejemplo n.º 1
0
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;
}
JNIEXPORT void JNICALL Java_ru_mmocore_external_recastnavigation_detour_NavMeshQuery_finalizeNative
  (JNIEnv *env, jobject, jlong context)
{
	NATIVE;

	dtFreeNavMeshQuery(d);
}
Ejemplo n.º 3
0
/**
 * 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;
   }
}
Ejemplo n.º 4
0
void dtCrowd::purge()
{
	for (int i = 0; i < m_maxAgents; ++i)
		m_agents[i].~dtCrowdAgent();
	dtFree(m_agents);
	m_agents = 0;
	m_maxAgents = 0;
	
	dtFree(m_activeAgents);
	m_activeAgents = 0;

	dtFree(m_agentAnims);
	m_agentAnims = 0;
	
	dtFree(m_pathResult);
	m_pathResult = 0;
	
	dtFreeProximityGrid(m_grid);
	m_grid = 0;

	dtFreeObstacleAvoidanceQuery(m_obstacleQuery);
	m_obstacleQuery = 0;
	
	dtFreeNavMeshQuery(m_navquery);
	m_navquery = 0;
}
Ejemplo n.º 5
0
Sample::~Sample()
{
	dtFreeNavMeshQuery(m_navQuery);
	dtFreeNavMesh(m_navMesh);
	dtFreeCrowd(m_crowd);
	delete m_tool;
}
NavMeshGenerator::~NavMeshGenerator()
{
	cleanup();

	dtFreeNavMeshQuery(m_navQuery);
	dtFreeNavMesh(m_navMesh);
	dtFreeCrowd(m_crowd);
}
Ejemplo n.º 7
0
void DetourInterface::detourCleanup()
{
	dtFreeNavMesh(_navMesh);
	_navMesh = 0;

	dtFreeNavMeshQuery(_navQuery);
	_navQuery = 0;
}
Ejemplo n.º 8
0
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];
}
Ejemplo n.º 9
0
	NavMeshLoader::~NavMeshLoader() {
		if (m_navMesh)
		{
			dtFreeNavMesh(m_navMesh);
		}
		if (m_navQuery)
		{
			dtFreeNavMeshQuery(m_navQuery);
		}
	}
Ejemplo n.º 10
0
void dtPathQueue::purge()
{
	dtFreeNavMeshQuery(m_navquery);
	m_navquery = 0;
	for (int i = 0; i < MAX_QUEUE; ++i)
	{
		dtFree(m_queue[i].path);
		m_queue[i].path = 0;
	}
}
//-------------------------------------------------------------------------------------
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));
}
Ejemplo n.º 12
0
PathInfo::~PathInfo()
{
    PATH_DEBUG("++ PathInfo::~PathInfo() for %u \n", m_sourceUnit->GetGUID());

    if (m_pathPolyRefs)
        delete [] m_pathPolyRefs;

    // m_navMesh is not ours to delete
    if (m_navMesh && m_navMeshQuery)
        dtFreeNavMeshQuery(m_navMeshQuery);
}
Ejemplo n.º 13
0
//-------------------------------------------------------------------------------------
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));
}
Ejemplo n.º 14
0
void NavigationMesh::ReleaseNavigationMesh()
{
    dtFreeNavMesh(navMesh_);
    navMesh_ = 0;
    
    dtFreeNavMeshQuery(navMeshQuery_);
    navMeshQuery_ = 0;
    
    numTilesX_ = 0;
    numTilesZ_ = 0;
    boundingBox_.min_ = boundingBox_.max_ = Vector3::ZERO;
    boundingBox_.defined_ = false;
}
Ejemplo n.º 15
0
//-------------------------------------------------------------------------------------
NavMeshEx::~NavMeshEx()
{
	KBEngine::thread::ThreadGuard tg(&mutex_); 
	KBEUnordered_map<std::string, NavMeshHandle*>::iterator iter = navmeshs_.begin();
	for(; iter != navmeshs_.end(); iter++)
	{
		NavMeshHandle* pNavMeshHandle = (NavMeshHandle*)iter->second;
		dtFreeNavMeshQuery(pNavMeshHandle->navmeshQuery);
		dtFreeNavMesh(pNavMeshHandle->navmesh);
		delete pNavMeshHandle;

		DEBUG_MSG(boost::format("NavMeshEx::~NavMeshEx(): (%1%) is destroyed!\n") % iter->first);
	}

	navmeshs_.clear();
}
Ejemplo n.º 16
0
//-------------------------------------------------------------------------------------
bool NavMeshEx::removeNavmesh(std::string name)
{
	KBEngine::thread::ThreadGuard tg(&mutex_); 
	KBEUnordered_map<std::string, NavMeshHandle*>::iterator iter = navmeshs_.find(name);
	if(navmeshs_.find(name) != navmeshs_.end())
	{
		NavMeshHandle* pNavMeshHandle = (NavMeshHandle*)iter->second;
		dtFreeNavMeshQuery(pNavMeshHandle->navmeshQuery);
		dtFreeNavMesh(pNavMeshHandle->navmesh);
		navmeshs_.erase(iter);
		delete pNavMeshHandle;

		DEBUG_MSG(boost::format("NavMeshEx::removeNavmesh: (%1%) is destroyed!\n") % name);
		return true;
	}

	return false;
}
Ejemplo n.º 17
0
NavMesh::~NavMesh()
{
    dtFreeTileCache(_tileCache);
    dtFreeCrowd(_crowed);
    dtFreeNavMesh(_navMesh);
    dtFreeNavMeshQuery(_navMeshQuery);
    CC_SAFE_DELETE(_allocator);
    CC_SAFE_DELETE(_compressor);
    CC_SAFE_DELETE(_meshProcess);
    CC_SAFE_DELETE(_geomData);

    for (auto iter : _agentList){
        CC_SAFE_RELEASE(iter);
    }
    _agentList.clear();

    for (auto iter : _obstacleList){
        CC_SAFE_RELEASE(iter);
    }
    _obstacleList.clear();
}
Ejemplo n.º 18
0
NavPath::~NavPath()
{
   dtFreeNavMeshQuery(mQuery);
   mQuery = NULL;
}
Ejemplo n.º 19
0
nav_mesh::~nav_mesh()
{
	dtFreeNavMeshQuery(query_);
	dtFreeNavMesh(mesh_);
}
Ejemplo n.º 20
0
dtCrowdQuery::~dtCrowdQuery()
{
	dtFreeNavMeshQuery(m_navMeshQuery);
	m_navMeshQuery = 0;
}
Ejemplo n.º 21
0
void destroyNavMeshQuery(void* value) {
	dtFreeNavMeshQuery(reinterpret_cast<dtNavMeshQuery*>(value));
}