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


C++ rcFreeContourSet函数代码示例

本文整理汇总了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;
	}
}
开发者ID:Dar13,项目名称:WastelandArchive,代码行数:29,代码来源:RecastInterface.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: rcFreeCompactHeightfield

 IntermediateValues::~IntermediateValues()
 {
     rcFreeCompactHeightfield(compactHeightfield);
     rcFreeHeightField(heightfield);
     rcFreeContourSet(contours);
     rcFreePolyMesh(polyMesh);
     rcFreePolyMeshDetail(polyMeshDetail);
 }
开发者ID:P-Kito,项目名称:InfinityCore,代码行数:8,代码来源:IntermediateValues.cpp

示例4: rcFreeContourSet

SimpleNavBuildData::~SimpleNavBuildData()
{
    rcFreeContourSet(contourSet_);
    contourSet_ = nullptr;
    rcFreePolyMesh(polyMesh_);
    polyMesh_ = nullptr;
    rcFreePolyMeshDetail(polyMeshDetail_);
    polyMeshDetail_ = nullptr;
}
开发者ID:1vanK,项目名称:Urho3D,代码行数:9,代码来源:NavBuildData.cpp

示例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;
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:14,代码来源:RecastTileBuilder.cpp

示例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;
}
开发者ID:jswigart,项目名称:recastnavigation,代码行数:15,代码来源:Sample_TileMesh.cpp

示例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;
}
开发者ID:vincent-grosbois,项目名称:sfml_test,代码行数:15,代码来源:NavMeshGenerator.cpp

示例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;
}
开发者ID:Conglang,项目名称:recastdetour,代码行数:17,代码来源:NavMeshCreator.cpp

示例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;
}
开发者ID:wtfcolt,项目名称:MadMangos,代码行数:17,代码来源:Sample_SoloMeshSimple.cpp

示例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();
   }
开发者ID:belzilep,项目名称:Torque3D,代码行数:18,代码来源:navMesh.cpp

示例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;
}
开发者ID:rwindegger,项目名称:recastnavigation,代码行数:24,代码来源:Sample_Debug.cpp

示例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;
开发者ID:Rastrian,项目名称:DeathCore_6.x-1,代码行数:67,代码来源:MapBuilder.cpp

示例13: rcFreeCompactHeightfield

Sample_Debug::~Sample_Debug()
{
	rcFreeCompactHeightfield(m_chf);
	rcFreeContourSet(m_cset);
	rcFreePolyMesh(m_pmesh);
}
开发者ID:rwindegger,项目名称:recastnavigation,代码行数:6,代码来源:Sample_Debug.cpp

示例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)
			{
开发者ID:ArtStealer,项目名称:recastnavigation,代码行数:67,代码来源:Sample_TileMesh.cpp

示例15: recast_destroyContourSet

void recast_destroyContourSet(struct recast_contourSet *contourSet)
{
	rcFreeContourSet((rcContourSet *) contourSet);
}
开发者ID:JasonWilkins,项目名称:blender-wayland,代码行数:4,代码来源:recast-capi.cpp


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