maspack.geometry
Class BVBoxNodeTester

java.lang.Object
  extended by maspack.geometry.BVBoxNodeTester
All Implemented Interfaces:
BVNodeTester

public class BVBoxNodeTester
extends java.lang.Object
implements BVNodeTester

A worker class that tests AABB and OBB bounding boxes for intersection. Each instance of this class expects the first and second bounding box to always be of a particular type, as specified by the enum BoxTypes.


Nested Class Summary
static class BVBoxNodeTester.BoxTypes
          Decsribes the type expected for the first and second bounding box.
 
Method Summary
static boolean isDisjoint(AABB box1, AABB box2)
           
 boolean isDisjoint(AABB box1, AABB box2, RigidTransform3d XBA)
           
 boolean isDisjoint(AABB box1, OBB box2, RigidTransform3d XBA)
           
 boolean isDisjoint(BVNode node1, BVNode node2, RigidTransform3d XBA)
          Returns true if node1 and node2 are disjoint.
 boolean isDisjoint(OBB box1, AABB box2, RigidTransform3d XBA)
           
static boolean isDisjoint(OBB box1, OBB box2)
           
 boolean isDisjoint(OBB box1, OBB box2, RigidTransform3d XBA)
           
static boolean isDisjoint(Vector3d hw1, Vector3d hw2, RotationMatrix3d R1, RotationMatrix3d R2, Vector3d pd, Vector3d px)
          Determines if two bounding boxes with half widths hw1 and hw2 are disjoint.
static boolean isDisjoint(Vector3d hw1, Vector3d hw2, RotationMatrix3d R21, Vector3d p21)
          Determines if two bounding boxes with half widths hw1 and hw2 are disjoint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDisjoint

public boolean isDisjoint(BVNode node1,
                          BVNode node2,
                          RigidTransform3d XBA)
Returns true if node1 and node2 are disjoint. The nodes may be described with respect to different coordinate frames.

Specified by:
isDisjoint in interface BVNodeTester
Parameters:
node1 - first bounding volume node
node2 - second bounding volume node
XBA - transform from the coordinate frame of node2 to the coordinate frame of node1. If the coordinate frames are the same, this should be set to RigidTransform3d.IDENTITY.
Returns:
true if the nodes are disjoint.

isDisjoint

public boolean isDisjoint(AABB box1,
                          AABB box2,
                          RigidTransform3d XBA)

isDisjoint

public boolean isDisjoint(AABB box1,
                          OBB box2,
                          RigidTransform3d XBA)

isDisjoint

public boolean isDisjoint(OBB box1,
                          AABB box2,
                          RigidTransform3d XBA)

isDisjoint

public boolean isDisjoint(OBB box1,
                          OBB box2,
                          RigidTransform3d XBA)

isDisjoint

public static boolean isDisjoint(OBB box1,
                                 OBB box2)

isDisjoint

public static boolean isDisjoint(AABB box1,
                                 AABB box2)

isDisjoint

public static final boolean isDisjoint(Vector3d hw1,
                                       Vector3d hw2,
                                       RotationMatrix3d R1,
                                       RotationMatrix3d R2,
                                       Vector3d pd,
                                       Vector3d px)
Determines if two bounding boxes with half widths hw1 and hw2 are disjoint. The first box is assumed to be axis-aligned and centered at the origin, while the coordinate frame of the second box has position and orientation given by
 p21 = R1^T pd + px
 R21 = R1^T R2
 
The reason for providing p21 and R21 in factored form is so their components can be computed on demand, as they may not all be needed before the test is decided.

For details on this algorithm, see pg 338 of Game Physics by David Eberly, or "OBBTree: A Hierarchichal Structure for Rapid Interference Detection", Gottschalk Lin & Manocha


isDisjoint

public static final boolean isDisjoint(Vector3d hw1,
                                       Vector3d hw2,
                                       RotationMatrix3d R21,
                                       Vector3d p21)
Determines if two bounding boxes with half widths hw1 and hw2 are disjoint. The first box is assumed to be axis-aligned and centered at the origin, while the coordinate frame of the second box has position and orientation given by p21 and R21, respectively.

For details on this algorithm, see pg 338 of Game Physics by David Eberly, or "OBBTree: A Hierarchichal Structure for Rapid Interference Detection", Gottschalk Lin & Manocha