//public void Dump(StreamWriter file)
//{
// file.WriteLine("Flags: " + flags);
// file.WriteLine("negChild: " + negChild);
// file.WriteLine("posChild: " + posChild);
// file.WriteLine("nFaces: " + nFaces);
// file.WriteLine("faceStart: " + faceStart);
// file.WriteLine("planeDist: " + planeDist);
// if (PolygonSet != null)
// {
// file.WriteLine("PolygonSet");
// for (var i = 0; i < PolygonSet.Length; i++)
// {
// file.WriteLine("\tVertex[{0}]:", i);
// file.WriteLine("\t\tPoint1: {0}", PolygonSet[i].Point1);
// file.WriteLine("\t\tPoint2: {0}", PolygonSet[i].Point2);
// file.WriteLine("\t\tPoint3: {0}", PolygonSet[i].Point3);
// }
// }
// file.WriteLine();
//}
//internal void HookUpChildren(IList<BSPNode> nodes)
//{
// if ((flags & BSPNodeFlags.Flag_Leaf) != 0 ||
// (flags & BSPNodeFlags.Flag_NoChild) != 0) return;
// var positiveChild = nodes[posChild];
// var negativeChild = nodes[negChild];
// if (positiveChild == null || negativeChild == null) return;
// Positive = positiveChild;
// Negative = negativeChild;
// Positive.HookUpChildren(nodes);
// Negative.HookUpChildren(nodes);
//}
//internal void GetVertices(List<Vector3> vertices)
//{
// if (TriIndices != null)
// {
// foreach (var index in TriIndices)
// {
// vertices.Add(triangle.Point1);
// vertices.Add(triangle.Point2);
// vertices.Add(triangle.Point3);
// }
// }
// if (Positive != null) Positive.GetVertices(vertices);
// if (Negative != null) Negative.GetVertices(vertices);
//}
internal void GetIndices(List <int> indices)
{
if (TriIndices != null)
{
foreach (var triangle in TriIndices)
{
indices.Add(triangle.Index0);
indices.Add(triangle.Index1);
indices.Add(triangle.Index2);
}
}
if (Positive != null)
{
Positive.GetIndices(indices);
}
if (Negative != null)
{
Negative.GetIndices(indices);
}
}