Superclass of the data used to create triangle mesh bounding box trees.
Exemplo n.º 1
0
 /// <summary>
 /// Creates a detector volume.
 /// </summary>
 /// <param name="triangleMesh">Arbitrary closed triangle mesh representing the volume.</param>
 /// <param name="queryAccelerator">System used to find nearby objects.</param>
 public DetectorVolume(MeshBoundingBoxTreeData triangleMesh, IQueryAccelerator queryAccelerator)
 {
     TriangleMesh = new TriangleMesh(triangleMesh);
     QueryAccelerator = queryAccelerator;
     collisionRules = new CollisionRules()
     {
          group = new CollisionGroup()
     };
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructs a new tree.
 /// </summary>
 /// <param name="data">Data to use to construct the tree.</param>
 public MeshBoundingBoxTree(MeshBoundingBoxTreeData data)
 {
     Data = data;
 }
Exemplo n.º 4
0
 internal override void Refit(MeshBoundingBoxTreeData data)
 {
     ChildA.Refit(data);
     ChildB.Refit(data);
     BoundingBox.CreateMerged(ref ChildA.BoundingBox, ref ChildB.BoundingBox, out BoundingBox);
 }
Exemplo n.º 5
0
 internal abstract void Refit(MeshBoundingBoxTreeData data);
Exemplo n.º 6
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);
 }
Exemplo n.º 7
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);
 }
Exemplo n.º 8
0
 internal abstract void Refit(MeshBoundingBoxTreeData data);
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
 internal override void Refit(MeshBoundingBoxTreeData data)
 {
     ChildA.Refit(data);
     ChildB.Refit(data);
     BoundingBox.CreateMerged(ref ChildA.BoundingBox, ref ChildB.BoundingBox, out BoundingBox);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Constructs a new tree.
 /// </summary>
 /// <param name="data">Data to use to construct the tree.</param>
 public MeshBoundingBoxTree(MeshBoundingBoxTreeData data)
 {
     Data = data;
 }