internal override void Refit(MeshBoundingBoxTreeData data)
 {
     data.GetBoundingBox(LeafIndex, out BoundingBox);
     //Having an ever-so-slight margin allows the hierarchy use a volume metric even for degenerate shapes (consider a flat tessellated plane).
     BoundingBox.Max.X += LeafMargin;
     BoundingBox.Max.Y += LeafMargin;
     BoundingBox.Max.Z += LeafMargin;
     BoundingBox.Min.X -= LeafMargin;
     BoundingBox.Min.Y -= LeafMargin;
     BoundingBox.Min.Z -= LeafMargin;
 }
예제 #2
0
 ///<summary>
 /// Constructs a new triangle mesh.
 ///</summary>
 ///<param name="data">Data to use to construct the mesh.</param>
 public TriangleMesh(MeshBoundingBoxTreeData data)
 {
     this.data = data;
     tree      = new MeshBoundingBoxTree(data);
 }
 /// <summary>
 /// Constructs a new tree.
 /// </summary>
 /// <param name="data">Data to use to construct the tree.</param>
 public MeshBoundingBoxTree(MeshBoundingBoxTreeData data)
 {
     Data = data;
 }
 internal override void Refit(MeshBoundingBoxTreeData data)
 {
     ChildA.Refit(data);
     ChildB.Refit(data);
     BoundingBox.CreateMerged(ref ChildA.BoundingBox, ref ChildB.BoundingBox, out BoundingBox);
 }
 internal abstract void Refit(MeshBoundingBoxTreeData data);