Interface ConstAaBox
- All Superinterfaces:
AutoCloseable,Comparable<JoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Implementing Classes:
AaBox
Read-only access to an
AaBox. (native type: const AABox)-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(float x, float y, float z) Test whether the box contains the specified point.booleancontains(ConstAaBox other) Test whether the current box contains the argument box.booleanTest whether the box contains the specified point.Locate the center of the box.getClosestPoint(float x, float y, float z) Locate the closest point on or in the box for the specified location.voidgetClosestPoint(float x, float y, float z, Vec3 storeResult) Locate the closest point on or in the box for the specified location.getClosestPoint(Vec3Arg location) Locate the closest point on or in the box for the specified location.Copy the (half) extent of the box.voidCopy the (half) extent of the box.getMax()Copy the maximum contained coordinate on each axis.voidCopy the maximum contained coordinate on each axis.getMin()Copy the minimum contained coordinate on each axis.voidCopy the minimum contained coordinate on each axis.getSize()Copy the size (full extent) on each axis.voidCopy the size (full extent) on each axis.floatgetSqDistanceTo(float x, float y, float z) Get the squared distance between the box and the specified point.floatgetSqDistanceTo(Vec3Arg point) Get the squared distance between the box and the specified point.getSupport(float x, float y, float z) Calculate the support vector for this convex shape.voidgetSupport(float x, float y, float z, Vec3 storeResult) Calculate the support vector for this convex shape.getSupport(Vec3Arg direction) Calculate the support vector for this convex shape.voidgetSupport(Vec3Arg direction, Vec3 storeResult) Calculate the support vector for this convex shape.floatGet surface area of bounding box.floatReturn the volume of the box.booleanisEqual(ConstAaBox other) Test whether the current box is equivalent to the argument.booleanisValid()Test whether the box is valid.booleanoverlaps(float constant, float normalX, float normalY, float normalZ) Check if this box overlaps with a plane.booleanoverlaps(ConstAaBox other) Check if this box overlaps with another box.booleanoverlaps(ConstPlane plane) Check if this box overlaps with a plane.scaled(float x, float y, float z) Return a scaled copy of the box.Return a scaled copy of the box.transformed(Mat44Arg matrix) Return a transformed copy of the box.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa, targetVaOrZero
-
Method Details
-
contains
Test whether the current box contains the argument box. Both boxes are unaffected.- Parameters:
other- the other box to check against (notnull, unaffected)- Returns:
trueif contained, otherwisefalse
-
contains
boolean contains(float x, float y, float z) Test whether the box contains the specified point. The box is unaffected.- Parameters:
x- the X coordinate of the point to testy- the Y coordinate of the point to testz- the Z coordinate of the point to test- Returns:
trueif contained, otherwisefalse
-
contains
Test whether the box contains the specified point. The box is unaffected.- Parameters:
point- the point to test (notnull, unaffected)- Returns:
trueif 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:
x- the X coordinate of the locationy- the Y coordinate of the locationz- the Z coordinate of the location- Returns:
- a new vector
-
getClosestPoint
Locate the closest point on or in the box for the specified location. The box is unaffected.- Parameters:
x- the X coordinate of the locationy- the Y coordinate of the locationz- the Z coordinate of the locationstoreResult- storage for the closest point (notnull, modified)
-
getClosestPoint
Locate the closest point on or in the box for the specified location. The box is unaffected.- Parameters:
location- the starting location (notnull, unaffected)- Returns:
- a new vector
-
getExtent
Vec3 getExtent()Copy the (half) extent of the box. The box is unaffected.- Returns:
- a new vector
-
getExtent
Copy the (half) extent of the box. The box is unaffected.- Parameters:
storeResult- storage for the extent (notnull, modified)
-
getMax
Vec3 getMax()Copy the maximum contained coordinate on each axis. The box is unaffected.- Returns:
- a new location vector
-
getMax
Copy the maximum contained coordinate on each axis. The box is unaffected.- Parameters:
storeResult- storage for the maximum (notnull, modified)
-
getMin
Vec3 getMin()Copy the minimum contained coordinate on each axis. The box is unaffected.- Returns:
- a new location vector
-
getMin
Copy the minimum contained coordinate on each axis. The box is unaffected.- Parameters:
storeResult- storage for the minimum (notnull, modified)
-
getSize
Vec3 getSize()Copy the size (full extent) on each axis. The box is unaffected.- Returns:
- a new vector
-
getSize
Copy the size (full extent) on each axis. The box is unaffected.- Parameters:
storeResult- storage for the size (notnull, modified)
-
getSqDistanceTo
float getSqDistanceTo(float x, float y, float z) Get the squared distance between the box and the specified point.- Parameters:
x- the X coordinate of the point to measure fromy- the Y coordinate of the point to measure fromz- the Z coordinate of the point to measure from- Returns:
- the distance, or zero if the point lies inside the box
-
getSqDistanceTo
Get the squared distance between the box and the specified point.- Parameters:
point- the point to measure from (notnull, unaffected)- Returns:
- the distance, or zero if
pointlies inside the box
-
getSupport
Calculate the support vector for this convex shape.- Parameters:
x- the X component of the direction vectory- the Y component of the direction vectorz- the Z component of the direction vector- Returns:
- the support vector
-
getSupport
Calculate the support vector for this convex shape. The shape is unaffected.- Parameters:
x- the X component of the direction vectory- the Y component of the direction vectorz- the Z component of the direction vectorstoreResult- storage for the support vector (notnull, modified)
-
getSupport
Calculate the support vector for this convex shape.- Parameters:
direction- the direction vector- Returns:
- the support vector
-
getSupport
Calculate the support vector for this convex shape. The shape is unaffected.- Parameters:
direction- the direction vector (notnull, unaffected)storeResult- storage for the support vector (notnull, modified)
-
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
-
isEqual
Test whether the current box is equivalent to the argument. Both boxes are unaffected.- Parameters:
other- the box to compare with (notnull, unaffected)- Returns:
trueif equal,falseif unequal
-
isValid
boolean isValid()Test whether the box is valid. It is unaffected.- Returns:
trueif valid, otherwisefalse
-
overlaps
Check if this box overlaps with another box.- Parameters:
other- the other box to check (notnull, unaffected)- Returns:
trueif they overlap, otherwisefalse
-
overlaps
Check if this box overlaps with a plane.- Parameters:
plane- thePlaneobject to be checked (notnull, unaffected)- Returns:
trueif they overlap, otherwisefalse
-
overlaps
boolean overlaps(float constant, float normalX, float normalY, float normalZ) Check if this box overlaps with a plane. The box is unaffected.- Parameters:
constant- the plane constantnormalX- the X component of the plane's normalnormalY- the Y component of the plane's normalnormalZ- the Z component of the plane's normal- Returns:
trueif they overlap, otherwisefalse
-
scaled
Return a scaled copy of the box. The current box is unaffected.- Parameters:
x- the scale factor to apply to the local X axisy- the scale factor to apply to the local Y axisz- the scale factor to apply to the local Z axis- Returns:
- a new object
-
scaled
Return a scaled copy of the box. The current box is unaffected.- Parameters:
factors- the scale factors to apply (notnull, unaffected)- Returns:
- a new object
-
transformed
Return a transformed copy of the box. The current box is unaffected.- Parameters:
matrix- the transformation to apply (notnull, unaffected)- Returns:
- a new object
-