public BoundingVolumeHierarchy(ITraceable nodeA, ITraceable nodeB, int splittingPlane) { this.splittingPlane = splittingPlane; this.nodeA = nodeA; this.nodeB = nodeB; this.Aabb = nodeA.GetAxisAlignedBoundingBox() + nodeB.GetAxisAlignedBoundingBox(); // we can cache this because it is not allowed to change. }
public BoundingVolumeHierarchy(ITraceable nodeA, ITraceable nodeB) { this.nodeA = nodeA; this.nodeB = nodeB; Aabb = nodeA.GetAxisAlignedBoundingBox() + nodeB.GetAxisAlignedBoundingBox(); splittingPlane = Aabb.XSize > Aabb.YSize ? 0 : 1; splittingPlane = Aabb.Size[splittingPlane] > Aabb.ZSize ? splittingPlane : 2; }
public AxisAlignedBoundingBox GetAxisAlignedBoundingBox() { return(primary.GetAxisAlignedBoundingBox()); }