Interface ConstAaBox
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstJoltPhysicsObject
- All Known Implementing Classes:
AaBox
Read-only access to an
AaBox
. (native type: const AABox)-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(ConstAaBox other) Test whether the current box contains the argument box.boolean
Test whether the box contains the specified point.Locate the center of the box.getClosestPoint
(Vec3Arg location) Locate the closest point on or in the box for the specified location.Copy the (half) extent of the box.getMax()
Copy the maximum contained coordinate on each axis.getMin()
Copy the minimum contained coordinate on each axis.getSize()
Copy the size (full extent) on each axis.float
getSqDistanceTo
(Vec3Arg point) Get the squared distance between the box and the specified point.getSupport
(Vec3Arg direction) Calculate the support vector for this convex shape.float
Get surface area of bounding box.float
Return the volume of the box.boolean
isValid()
Test whether the box is valid.boolean
overlaps
(ConstAaBox other) Check if this box overlaps with another box.boolean
overlaps
(ConstPlane plane) Check if this box overlaps with a plane.Return a scaled copy of the box.transformed
(Mat44Arg matrix) Return a transformed copy of the box.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
contains
Test whether the current box contains the argument box. The current box is unaffected.- Parameters:
other
- the other box to check against (not null, unaffected)- Returns:
true
if contained, otherwisefalse
-
contains
Test whether the box contains the specified point. The box is unaffected.- Parameters:
point
- the point to test (not null, unaffected)- Returns:
true
if contained, otherwisefalse
-
getCenter
Vec3 getCenter()Locate the center of the box. The box is unaffected.- Returns:
- a new location vector
-
getClosestPoint
Locate the closest point on or in the box for the specified location. The box is unaffected.- Parameters:
location
- the starting location (not null, unaffected)- Returns:
- a new vector
-
getExtent
Vec3 getExtent()Copy the (half) extent of the box. The box is unaffected.- Returns:
- a new vector
-
getMax
Vec3 getMax()Copy the maximum contained coordinate on each axis. The box is unaffected.- Returns:
- a new location vector
-
getMin
Vec3 getMin()Copy the minimum contained coordinate on each axis. The box is unaffected.- Returns:
- a new location vector
-
getSize
Vec3 getSize()Copy the size (full extent) on each axis. The box is unaffected.- Returns:
- a new vector
-
getSqDistanceTo
Get the squared distance between the box and the specified point.- Parameters:
point
- the point to measure from (not null, unaffected)- Returns:
- the distance, or zero if
point
lies inside the box
-
getSupport
Calculate the support vector for this convex shape.- Parameters:
direction
- the direction vector- Returns:
- the support vector
-
getSurfaceArea
float getSurfaceArea()Get surface area of bounding box.- Returns:
- the area
-
getVolume
float getVolume()Return the volume of the box. The box is unaffected.- Returns:
- the volume
-
isValid
boolean isValid()Test whether the box is valid. It is unaffected.- Returns:
true
if valid, otherwisefalse
-
overlaps
Check if this box overlaps with another box.- Parameters:
other
- the other box to check- Returns:
true
if they overlap, otherwisefalse
-
overlaps
Check if this box overlaps with a plane.- Parameters:
plane
- thePlane
object to be checked- Returns:
true
if they overlap, otherwisefalse
-
scaled
Return a scaled copy of the box. The current box is unaffected.- Parameters:
factors
- the scale factors to apply (not null, unaffected)- Returns:
- a new object
-
transformed
Return a transformed copy of the box. The current box is unaffected.- Parameters:
matrix
- the transformation to apply (not null, unaffected)- Returns:
- a new object
-