本文整理汇总了C#中Plane.distance方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.distance方法的具体用法?C# Plane.distance怎么用?C# Plane.distance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane
的用法示例。
在下文中一共展示了Plane.distance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: decompile
//.........这里部分代码省略.........
}
}
}
}
}
for (int j = 0; j < sectorFloorBrushes[i].Length; j++)
{
if (!cielingsUsed[j])
{
world.Brushes.Add(sectorCielingBrushes[i][j]);
}
if (!floorsUsed[j])
{
world.Brushes.Add(sectorFloorBrushes[i][j]);
}
}
}
// Convert THINGS
for (int i = 0; i < doomMap.Things.Count; i++)
{
DThing currentThing = doomMap.Things[i];
// To find the true height of a thing, I need to iterate through nodes until I come to a subsector
// definition. Then I need to use the floor height of the sector that subsector belongs to.
Vector3D origin = currentThing.Origin;
int subsectorIndex = doomMap.Nodes.Count - 1;
while (subsectorIndex >= 0)
{
// Once child is negative, subsector is found
DNode currentNode = doomMap.Nodes[subsectorIndex];
Vector3D start = currentNode.VecHead;
Vector3D end = currentNode.VecHead+currentNode.VecTail;
Plane currentPlane = new Plane(start, end, new Vector3D(start.X, start.Y, 1));
if (currentPlane.distance(origin) < 0)
{
subsectorIndex = currentNode.Child1;
}
else
{
subsectorIndex = currentNode.Child2;
}
}
subsectorIndex += 32768;
int sectorIndex = subsectorSectors[subsectorIndex];
DSector thingSector = doomMap.Sectors[sectorIndex];
if (origin.Z == 0)
{
origin.Z=thingSector.FloorHeight;
}
Entity thing = null;
// Things from both Doom. Currently converting to appropriate Doom 3 entities.
switch (currentThing.ClassNum)
{
case 1:
// Single player spawn
case 2:
// coop
case 3:
// coop
case 4: // coop
thing = new Entity("info_player_start");
if (currentThing.ClassNum > 1)
{
thing["targetname"] = "coopspawn" + currentThing.ClassNum;
}