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


C# Face.GetPlane方法代码示例

本文整理汇总了C#中Face.GetPlane方法的典型用法代码示例。如果您正苦于以下问题:C# Face.GetPlane方法的具体用法?C# Face.GetPlane怎么用?C# Face.GetPlane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Face的用法示例。


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

示例1: PerformNode


//.........这里部分代码省略.........
				{
					PerformNode( inNode.front, frontFace, nodeSide, info );
				}
				
				// Prcess back node with back face
				if( inNode.back == null )
				{
					// 
					info.leafNode = inNode;
					info.leafLocation = BspNode.EBspLocation.BspLocation_Back;
		
					
					ProcessFace( backFace, SIDE_Inside, info );
				}
				else
				{
					// process back node with new face
					PerformNode( inNode.back, backFace, nodeSide, info );	
				}
				
				// stop loop
				inNode = null;
				break;
			case Face.EPlaneSide.Side_Planar:
				
				BspNode front, back;
				
				if( info.wasPlanar == true )
				{
					Debug.Log( "Reentering Planar Nodes!" );	
				}
				
				
				// set operation infos
				info.wasPlanar = true;
				info.backNode = null;
				info.processingBack = false;
				
				if( Vector3.Dot( inFace.GetPlane().normal, inNode.plane.normal ) >= 0.0f )
				{
					// same order as we face in the same order
					front = inNode.front;
					back = inNode.back;
					
					// we are for now outside (as we are looking outside)
					info.planarSide = SIDE_Outside;
				}
				else
				{
					// reverse order as we are facing in the opposite direction
					front = inNode.back;
					back = inNode.front;
					
					// we are now inside as we are looking to the inside
					info.planarSide = SIDE_Inside;
				}
				
				// we are leaf node (coplanar face)
				if( front == null && back == null )
				{
					// set leaf stuff
					info.leafNode = inNode;
					info.leafLocation = BspNode.EBspLocation.BspLocation_Planar;
									
					// process node
					info.processingBack = true;
					
					// process face
					ProcessFace( inFace, InverseSide(info.planarSide), info );
					
					// stop loop
					inNode = null;
				}
				else if( front == null && back != null )
				{
					// only back nodes
					info.processingBack = true;
					
					// process back
					inNode = back;
				}
				else
				{
					
					// tread like we were on front side (maybe we do have a back node)
					info.processingBack = false;
					
					// remember back node
					info.backNode = back;
					
					// process front
					inNode = front;
				}
				
				break;
			}
			
			
		}
	}
开发者ID:icegbq,项目名称:csg-unity,代码行数:101,代码来源:CsgOperation.cs

示例2: AddNode

	public static BspNode AddNode( BspNode inParent, BspNode.EBspLocation inLocation, Face inFace, int inFlags )
	{
		BspNode newNode = new BspNode();
		
		newNode.plane = inFace.GetPlane();
		newNode.face = inFace;
		newNode.front = newNode.back = newNode.planar = null;
		newNode.flags = inFlags;
		
		if( inLocation == BspNode.EBspLocation.BspLocation_Front )
		{
			// check that front node is null
			inParent.front = newNode;
			
		}
		else if( inLocation == BspNode.EBspLocation.BspLocation_Back )
		{
			// TODO: check that back node is null
			inParent.back = newNode;	
		}
		else if( inLocation == BspNode.EBspLocation.BspLocation_Planar )
		{
			// go to the last planar node
			BspNode lastPlanar = inParent;
			
			while( lastPlanar.planar != null )
				lastPlanar = lastPlanar.planar;
			
			// add planar node
			lastPlanar.planar = newNode;
		}
		
		return newNode;
	}
开发者ID:icegbq,项目名称:csg-unity,代码行数:34,代码来源:BspGen.cs


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