本文整理汇总了C#中Face.Split方法的典型用法代码示例。如果您正苦于以下问题:C# Face.Split方法的具体用法?C# Face.Split怎么用?C# Face.Split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Face
的用法示例。
在下文中一共展示了Face.Split方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNodeRecursive
public static BspNode AddNodeRecursive( BspNode inNode, Face inFace, int inFlags )
{
while( inNode != null )
{
Face.EPlaneSide planeSide = inFace.Side( inNode.plane );
switch( planeSide )
{
case Face.EPlaneSide.Side_Front:
if( inNode.front == null )
return AddNode( inNode, BspNode.EBspLocation.BspLocation_Front, inFace, inFlags );
inNode = inNode.front;
break;
case Face.EPlaneSide.Side_Back:
if( inNode.back == null )
return AddNode( inNode, BspNode.EBspLocation.BspLocation_Back, inFace, inFlags );
inNode = inNode.back;
break;
case Face.EPlaneSide.Side_Planar:
return AddNode( inNode, BspNode.EBspLocation.BspLocation_Planar, inFace, inFlags );
case Face.EPlaneSide.Side_Split:
Face frontFace, backFace;
inFace.Split( inNode.plane, out frontFace, out backFace );
if( inNode.front == null )
{
AddNode( inNode, BspNode.EBspLocation.BspLocation_Front, frontFace, inFlags );
}
else
{
AddNodeRecursive( inNode.front, frontFace, inFlags );
}
if( inNode.back == null )
{
AddNode( inNode, BspNode.EBspLocation.BspLocation_Back, inFace, inFlags );
}
else
{
AddNodeRecursive( inNode.back, backFace, inFlags );
}
inNode = null;
break;
}
}
// happens when face get splitted...
return null;
}
示例2: PerformNode
private void PerformNode( BspNode inNode, Face inFace, int nodeSide, OperationInfo info )
{
while( inNode != null )
{
Face.EPlaneSide side = inFace.Side( inNode.plane );
switch( side )
{
case Face.EPlaneSide.Side_Front:
//
nodeSide = nodeSide | (inNode.IsCsg() ? 1 : 0);
// leaf node
if( inNode.front == null )
{
// set operation infos
info.leafNode = inNode;
info.leafLocation = BspNode.EBspLocation.BspLocation_Front;
// we are done, process face
ProcessFace( inFace, SIDE_Outside, info );
}
// get to next front node (if any)
inNode = inNode.front;
break;
case Face.EPlaneSide.Side_Back:
int backSide = inNode.IsCsg() ? 0 : 1;
//
nodeSide = nodeSide & backSide;
// leaf node
if( inNode.back == null )
{
// set leaf infos
info.leafNode = inNode;
info.leafLocation = BspNode.EBspLocation.BspLocation_Back;
// we are done, process face
ProcessFace( inFace, SIDE_Inside, info );
}
// get to next front node (if any)
inNode = inNode.back;
break;
case Face.EPlaneSide.Side_Split:
// split face and process front and back
Face frontFace, backFace;
//
inFace.Split( inNode.plane, out frontFace, out backFace );
// TODO: set polygon cutted flags
frontFace.flags |= Face.FaceFlags_WasCutted;
backFace.flags |= Face.FaceFlags_WasCutted;
// front node is a leaf node
if( inNode.front == null )
{
//
info.leafNode = inNode;
info.leafLocation = BspNode.EBspLocation.BspLocation_Front;
ProcessFace( frontFace, SIDE_Outside, info );
}
else
{
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 )
//.........这里部分代码省略.........
示例3: InsertPointInTriangle
static void InsertPointInTriangle(Face triangle, Vector3 point)
{
triangle.Split().position = point;
}