public BSPNode(DatLoader.Entity.BSPNode node, Dictionary <ushort, DatLoader.Entity.Polygon> polys, DatLoader.Entity.CVertexArray vertexArray) { if (node.Sphere != null) { Sphere = new Sphere(node.Sphere); } if (node.SplittingPlane != null) { SplittingPlane = node.SplittingPlane.ToNumerics(); } Type = (BSPTreeType)node.Type; //Typename if (node.InPolys != null) { NumPolys = node.InPolys.Count; PolyIDs = node.InPolys; Polygons = new List <Polygon>(); foreach (var poly in node.InPolys) { Polygons.Add(new Polygon(polys[poly], vertexArray)); } } if (node.PosNode != null) { if (!(node.PosNode is DatLoader.Entity.BSPLeaf)) { PosNode = new BSPNode(node.PosNode, polys, vertexArray); } else // portal? { PosNode = new BSPLeaf((DatLoader.Entity.BSPLeaf)node.PosNode, polys, vertexArray); } } if (node.NegNode != null) { if (!(node.NegNode is DatLoader.Entity.BSPLeaf)) { NegNode = new BSPNode(node.NegNode, polys, vertexArray); } else // portal? { NegNode = new BSPLeaf((DatLoader.Entity.BSPLeaf)node.NegNode, polys, vertexArray); } } }
public BSPNode(BSPTreeType type) { Type = type; }
public BSPLeaf(BSPTreeType type) : base(type) { }