Class ContBox3f
- java.lang.Object
-
- WildMagic.LibFoundation.Containment.ContBox3f
-
- All Implemented Interfaces:
java.io.Serializable
public class ContBox3f extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ContBox3f()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Box3f
ContAlignedBox(int iQuantity, Vector3f[] akPoint)
Compute the smallest axis-aligned bounding box of the points.static Box3f
ContOrientedBox(int iQuantity, java.util.Vector<Vector3f> kMeshVertices)
Compute an oriented bounding box of the points.static boolean
InBox(Vector3f rkPoint, Box3f rkBox)
Test for containment.static Box3f
MergeBoxes(Box3f rkBox0, Box3f rkBox1)
Construct an oriented box that contains two other oriented boxes.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
ContAlignedBox
public static Box3f ContAlignedBox(int iQuantity, Vector3f[] akPoint)
Compute the smallest axis-aligned bounding box of the points.- Parameters:
iQuantity
- number of pointsakPoint
- points to examine- Returns:
- bounding box
-
ContOrientedBox
public static Box3f ContOrientedBox(int iQuantity, java.util.Vector<Vector3f> kMeshVertices)
Compute an oriented bounding box of the points. The box center is the average of the points. The box axes are the eigenvectors of the covariance matrix.- Parameters:
iQuantity
- number of pointskMeshVertices
- vertices to examine- Returns:
- bounding box
-
InBox
public static boolean InBox(Vector3f rkPoint, Box3f rkBox)
Test for containment. Let X = C + y0*U0 + y1*U1 + y2*U2 where C is the box center and U0, U1, U2 are the orthonormal axes of the box. X is in the box if |y_i| <= E_i for all i where E_i are the extents of the box.- Parameters:
rkPoint
- point to test for containmentrkBox
- box container- Returns:
- true if rkPoint is inside rkBox
-
MergeBoxes
public static Box3f MergeBoxes(Box3f rkBox0, Box3f rkBox1)
Construct an oriented box that contains two other oriented boxes. The result is not guaranteed to be the minimum volume box containing the input boxes.- Parameters:
rkBox0
- first box to mergerkBox1
- second box to merge- Returns:
- merged box
-
-