当前位置: 首页>>代码示例>>C++>>正文


C++ dtFreeNavMesh函数代码示例

本文整理汇总了C++中dtFreeNavMesh函数的典型用法代码示例。如果您正苦于以下问题:C++ dtFreeNavMesh函数的具体用法?C++ dtFreeNavMesh怎么用?C++ dtFreeNavMesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dtFreeNavMesh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(&params, 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(&params);
    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


注:本文中的dtFreeNavMesh函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。