• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ idBrushBSP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了idBrushBSP类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GravitationalSubdivision

/*
============
idAASBuild::GravitationalSubdivision
============
*/
void idAASBuild::GravitationalSubdivision( idBrushBSP &bsp ) {
	numGravitationalSubdivisions = 0;

	common->Printf( "[Gravitational Subdivision]\n" );

	SetPortalFlags_r( bsp.GetRootNode() );
	GravSubdiv_r( bsp.GetRootNode() );

	common->Printf( "\r%6d subdivisions\n", numGravitationalSubdivisions );
}
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:15,代码来源:AASBuild_gravity.cpp


示例2: MergeLeafNodes

/*
============
idAASBuild::MergeLeafNodes
============
*/
void idAASBuild::MergeLeafNodes( idBrushBSP &bsp ) {
	numMergedLeafNodes = 0;

	common->Printf( "[Merge Leaf Nodes]\n" );

	MergeLeafNodes_r( bsp, bsp.GetRootNode() );
	bsp.GetRootNode()->RemoveFlagRecurse( NODE_DONE );
	bsp.PruneMergedTree_r( bsp.GetRootNode() );

	common->Printf( "\r%6d leaf nodes merged\n", numMergedLeafNodes );
}
开发者ID:RobertBeckebans,项目名称:fhDOOM,代码行数:16,代码来源:AASBuild_merge.cpp


示例3: LedgeSubdivision

/*
============
idAASBuild::LedgeSubdivision

  NOTE: this assumes the bounding box is higher than the maximum step height
		only ledges with vertical sides are considered
============
*/
void idAASBuild::LedgeSubdivision( idBrushBSP &bsp ) {
	numLedgeSubdivisions = 0;
	ledgeList.Clear();
	common->Printf( "[Ledge Subdivision]\n" );
	bsp.GetRootNode()->RemoveFlagRecurse( NODE_VISITED );
	FindLedges_r( bsp.GetRootNode(), bsp.GetRootNode() );
	bsp.GetRootNode()->RemoveFlagRecurse( NODE_VISITED );
	common->Printf( "\r%6d ledges\n", ledgeList.Num() );
	LedgeSubdiv( bsp.GetRootNode() );
	common->Printf( "\r%6d subdivisions\n", numLedgeSubdivisions );
}
开发者ID:revelator,项目名称:Revelation,代码行数:19,代码来源:AASBuild_ledge.cpp


示例4: StoreFile

/*
================
idAASBuild::StoreFile
================
*/
bool idAASBuild::StoreFile( const idBrushBSP& bsp )
{
	aasEdge_t edge;
	aasFace_t face;
	aasArea_t area;
	aasNode_t node;
	
	common->Printf( "[Store AAS]\n" );
	
	SetupHash();
	ClearHash( bsp.GetTreeBounds() );
	
	file = new idAASFileLocal();
	
	file->Clear();
	
	SetSizeEstimate( bsp, file );
	
	// the first edge is a dummy
	memset( &edge, 0, sizeof( edge ) );
	file->edges.Append( edge );
	
	// the first face is a dummy
	memset( &face, 0, sizeof( face ) );
	file->faces.Append( face );
	
	// the first area is a dummy
	memset( &area, 0, sizeof( area ) );
	file->areas.Append( area );
	
	// the first node is a dummy
	memset( &node, 0, sizeof( node ) );
	file->nodes.Append( node );
	
	// store the tree
	StoreTree_r( bsp.GetRootNode() );
	
	// calculate area bounds and a reachable point in the area
	file->FinishAreas();
	
	ShutdownHash();
	
	common->Printf( "\r%6d areas\n", file->areas.Num() );
	
	return true;
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:51,代码来源:AASBuild_file.cpp


示例5: MergeWithAdjacentLeafNodes

/*
============
idAASBuild::MergeWithAdjacentLeafNodes
============
*/
bool idAASBuild::MergeWithAdjacentLeafNodes( idBrushBSP &bsp, idBrushBSPNode *node ) {
	int s, numMerges = 0, otherNodeFlags;
	idBrushBSPPortal *p;

	do {
		for ( p = node->GetPortals(); p; p = p->Next(s) ) {
			s = (p->GetNode(1) == node);

			// both leaf nodes must have the same contents
			if ( node->GetContents() != p->GetNode(!s)->GetContents() ) {
				continue;
			}

			// cannot merge leaf nodes if one is near a ledge and the other is not
			if ( (node->GetFlags() & AREA_LEDGE) != (p->GetNode(!s)->GetFlags() & AREA_LEDGE) ) {
				continue;
			}

			// cannot merge leaf nodes if one has a floor portal and the other a gap portal
			if ( node->GetFlags() & AREA_FLOOR ) {
				if ( p->GetNode(!s)->GetFlags() & AREA_GAP ) {
					if ( !AllGapsLeadToOtherNode( p->GetNode(!s), node ) ) {
						continue;
					}
				}
			}
			else if ( node->GetFlags() & AREA_GAP ) {
				if ( p->GetNode(!s)->GetFlags() & AREA_FLOOR ) {
					if ( !AllGapsLeadToOtherNode( node, p->GetNode(!s) ) ) {
						continue;
					}
				}
			}

			otherNodeFlags = p->GetNode(!s)->GetFlags();

			// try to merge the leaf nodes
			if ( bsp.TryMergeLeafNodes( p, s ) ) {
				node->SetFlag( otherNodeFlags );
				if ( node->GetFlags() & AREA_FLOOR ) {
					node->RemoveFlag( AREA_GAP );
				}
				numMerges++;
				DisplayRealTimeString( "\r%6d", ++numMergedLeafNodes );
				break;
			}
		}
	} while( p );

	if ( numMerges ) {
		return true;
	}
	return false;
}
开发者ID:RobertBeckebans,项目名称:fhDOOM,代码行数:59,代码来源:AASBuild_merge.cpp


示例6: SetSizeEstimate

/*
================
idAASBuild::SetSizeEstimate
================
*/
void idAASBuild::SetSizeEstimate( const idBrushBSP &bsp, idAASFileLocal *file ) {
	sizeEstimate_t size;

	size.numEdgeIndexes = 1;
	size.numFaceIndexes = 1;
	size.numAreas = 1;
	size.numNodes = 1;

	GetSizeEstimate_r( NULL, bsp.GetRootNode(), size );

	file->planeList.Resize( size.numNodes / 2, 1024 );
	file->vertices.Resize( size.numEdgeIndexes / 3, 1024 );
	file->edges.Resize( size.numEdgeIndexes / 2, 1024 );
	file->edgeIndex.Resize( size.numEdgeIndexes, 4096 );
	file->faces.Resize( size.numFaceIndexes, 1024 );
	file->faceIndex.Resize( size.numFaceIndexes, 4096 );
	file->areas.Resize( size.numAreas, 1024 );
	file->nodes.Resize( size.numNodes, 1024 );
}
开发者ID:tankorsmash,项目名称:quadcow,代码行数:24,代码来源:AASBuild_file.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ idBrushList类代码示例发布时间:2022-05-31
下一篇:
C++ idBounds类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap