本文整理汇总了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;
}
}
}
示例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;
}