Exemplo n.º 1
0
        private void DumpBranchContents(TextWriter file, BSPNode startAt, IList <Vector3> vectors)
        {
            // Write the vertices referenced by the first
            var posVertList = new List <Vector3>();

            GetBranchContents(startAt.posChild, vectors, posVertList);
            file.WriteLine("Positive Polys: {0}", posVertList.Count);
            file.WriteLine("_______________");
            file.Write(file.NewLine);

            var min = new Vector3(float.MaxValue);
            var max = new Vector3(float.MinValue);

            foreach (var vert in posVertList)
            {
                min = Vector3.Min(min, vert);
                max = Vector3.Max(max, vert);
            }
            file.WriteLine("MinVals: {0}", min);
            file.WriteLine("MaxVals: {0}", max);
            file.WriteLine(file.NewLine);

            //Write the vertices referenced by the last
            var negVertList = new List <Vector3>();

            GetBranchContents(startAt.negChild, vectors, negVertList);
            file.WriteLine("Negative Polys: {0}", negVertList.Count);
            file.WriteLine("_______________");
            file.Write(file.NewLine);

            min = new Vector3(float.MaxValue);
            max = new Vector3(float.MinValue);
            foreach (var vert in negVertList)
            {
                min = Vector3.Min(min, vert);
                max = Vector3.Max(max, vert);
            }
            file.WriteLine("MinVals: {0}", min);
            file.WriteLine("MaxVals: {0}", max);
            file.WriteLine(file.NewLine);
        }
Exemplo n.º 2
0
        private void DumpBranchContents(TextWriter file, BSPNode startAt, IList<Vector3> vectors)
        {
            // Write the vertices referenced by the first
            var posVertList = new List<Vector3>();
            GetBranchContents(startAt.posChild, vectors, posVertList);
            file.WriteLine("Positive Polys: {0}", posVertList.Count);
            file.WriteLine("_______________");
            file.Write(file.NewLine);

            var min = new Vector3(float.MaxValue);
            var max = new Vector3(float.MinValue);
            foreach (var vert in posVertList)
            {
                min = Vector3.Min(min, vert);
                max = Vector3.Max(max, vert);
            }
            file.WriteLine("MinVals: {0}", min);
            file.WriteLine("MaxVals: {0}", max);
            file.WriteLine(file.NewLine);

            //Write the vertices referenced by the last
            var negVertList = new List<Vector3>();
            GetBranchContents(startAt.negChild, vectors, negVertList);
            file.WriteLine("Negative Polys: {0}", negVertList.Count);
            file.WriteLine("_______________");
            file.Write(file.NewLine);

            min = new Vector3(float.MaxValue);
            max = new Vector3(float.MinValue);
            foreach (var vert in negVertList)
            {
                min = Vector3.Min(min, vert);
                max = Vector3.Max(max, vert);
            }
            file.WriteLine("MinVals: {0}", min);
            file.WriteLine("MaxVals: {0}", max);
            file.WriteLine(file.NewLine);
        }
Exemplo n.º 3
0
 public BSPTree(short rootId, BSPNode[] nodes)
 {
     this.rootId = rootId;
     this.nodes = nodes;
 }