Exemple #1
0
        public AABBTreeNode(BinaryReader br)
        {
            aabb.Min.X = br.ReadSingle();
            aabb.Min.Y = br.ReadSingle();
            aabb.Min.Z = br.ReadSingle();

            aabb.Max.X = br.ReadSingle();
            aabb.Max.Y = br.ReadSingle();
            aabb.Max.Z = br.ReadSingle();

            int childrenCount = br.ReadInt32();

            if (childrenCount == 0)
            {
                faceData = new TreeFace();
                faceData.ReadData(br);
            }
            else
            {
                children = new BaseTreeNode[childrenCount];
                for (int i = 0; i < childrenCount; i++)
                {
                    children[i] = new AABBTreeNode(br);
                }
            }
        }
Exemple #2
0
        public BBTreeNode(BinaryReader br)
        {
            ball.Center.X = br.ReadSingle();
            ball.Center.Y = br.ReadSingle();
            ball.Center.Z = br.ReadSingle();

            ball.Radius = br.ReadSingle();

            int childrenCount = br.ReadInt32();

            if (childrenCount == 0)
            {
                faceData = new TreeFace();
                faceData.ReadData(br);
            }
            else
            {
                children = new BaseTreeNode[childrenCount];
                for (int i = 0; i < childrenCount; i++)
                {
                    children[i] = new AABBTreeNode(br);
                }
            }
        }