java.lang.Object
com.marginallyclever.ro3.mesh.AABB
- All Implemented Interfaces:
BoundingVolume,Serializable
AABB is a bounding box aligned to the world axies. Used for fast sorting and filtering.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.vecmath.Point3djavax.vecmath.Point3ddoublegetCentroidAxis(int axis) Return the nth component of the centroid.doubledoubledoublegetShape()voidgrow(javax.vecmath.Point3d p) Grow this AABB to include the point b.voidvoidsetBounds(javax.vecmath.Point3d newMax, javax.vecmath.Point3d newMin) voidAABB[]Subdivide this AABB into 8 smaller AABBs.doublevoidGrow this AABB to include the other AABB.
-
Constructor Details
-
AABB
public AABB() -
AABB
-
-
Method Details
-
set
-
setBounds
public void setBounds(javax.vecmath.Point3d newMax, javax.vecmath.Point3d newMin) - Parameters:
newMax- upper boundsnewMin- lower bounds
-
getBoundsTop
public javax.vecmath.Point3d getBoundsTop() -
getBoundsBottom
public javax.vecmath.Point3d getBoundsBottom() -
getExtentX
public double getExtentX() -
getExtentY
public double getExtentY() -
getExtentZ
public double getExtentZ() -
setShape
-
getShape
-
intersect
-
subdivide
Subdivide this AABB into 8 smaller AABBs.- Returns:
- 8 new AABBs that are subdivisions of this AABB.
-
grow
public void grow(javax.vecmath.Point3d p) Grow this AABB to include the point b.- Parameters:
p- the point to include in the AABB.
-
union
Grow this AABB to include the other AABB.- Parameters:
other- the AABB to include in this AABB.
-
getCentroidAxis
public double getCentroidAxis(int axis) Return the nth component of the centroid. The centroid is the midpoint between min and max limits.- Parameters:
axis- 0, 1,or 2.- Returns:
- the nth component of the centroid. 0 for x, 1 for y, and all others for z.
-
surfaceArea
public double surfaceArea()- Returns:
- the surface area of the entire
AABB.
-