java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.AaBox
- All Implemented Interfaces:
ConstAaBox
,ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
An axis-aligned box. (native type: AABox)
-
Constructor Summary
ConstructorsConstructorDescriptionAaBox()
Instantiate an invalid box.Instantiate a box with the specified minimum and maximum coordinates.Instantiate a cubic box with the specified center coordinates and half extent.Instantiate a box with the specified minimum and maximum coordinates. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether the box contains the specified point.void
encapsulate
(Vec3Arg location) Enlarge the box to include the specified location.void
Enlarge the box on all sides by the specified amounts.Locate the center of the box.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
Return the volume of the box.boolean
isValid()
Test whether the box is valid.static AaBox
sBiggest()
Instantiate the biggest finite box.void
setEmpty()
Alter the box to be empty.void
Alter the maximum coordinates.void
Alter the minimum coordinates.void
Move by the specified offset.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
AaBox
public AaBox()Instantiate an invalid box. -
AaBox
Instantiate a box with the specified minimum and maximum coordinates.- Parameters:
minimum
- the desired minimum coordinates (not null, unaffected)maximum
- the desired maximum coordinates (not null, unaffected)
-
AaBox
Instantiate a cubic box with the specified center coordinates and half extent.- Parameters:
center
- the desired center coordinates (not null, unaffected)halfExtent
- the desired half extent
-
AaBox
Instantiate a box with the specified minimum and maximum coordinates.- Parameters:
minimum
- the desired minimum coordinates (not null, unaffected)maximum
- the desired maximum coordinates (not null, unaffected)
-
-
Method Details
-
encapsulate
Enlarge the box to include the specified location.- Parameters:
location
- the location to include (not null, unaffected)
-
expandBy
Enlarge the box on all sides by the specified amounts.- Parameters:
deltas
- the amount to increase the half extent on each axis (not null, unaffected)
-
sBiggest
Instantiate the biggest finite box.- Returns:
- a new JVM object with a new native object assigned
-
setEmpty
public void setEmpty()Alter the box to be empty. -
setMax
Alter the maximum coordinates. (native attribute: mMax)- Parameters:
max
- the desired maximum coordinate for each axis (not null, unaffected)
-
setMin
Alter the minimum coordinates. (native attribute: mMin)- Parameters:
min
- the desired minimum coordinate for each axis (not null, unaffected)
-
translate
Move by the specified offset.- Parameters:
offset
- the amount to move (not null, unaffected)
-
contains
Test whether the box contains the specified point. The box is unaffected.- Specified by:
contains
in interfaceConstAaBox
- Parameters:
point
- the point to test (not null, unaffected)- Returns:
true
if contained, otherwisefalse
-
getCenter
Locate the center of the box. The box is unaffected.- Specified by:
getCenter
in interfaceConstAaBox
- Returns:
- a new location vector
-
getExtent
Copy the (half) extent of the box. The box is unaffected.- Specified by:
getExtent
in interfaceConstAaBox
- Returns:
- a new vector
-
getMax
Copy the maximum contained coordinate on each axis. The box is unaffected. (native attribute: mMax)- Specified by:
getMax
in interfaceConstAaBox
- Returns:
- a new vector
-
getMin
Copy the minimum contained coordinate on each axis. The box is unaffected. (native attribute: mMin)- Specified by:
getMin
in interfaceConstAaBox
- Returns:
- a new vector
-
getSize
Copy the size (full extent) on each axis. The box is unaffected.- Specified by:
getSize
in interfaceConstAaBox
- Returns:
- a new vector
-
getVolume
public float getVolume()Return the volume of the box. The box is unaffected.- Specified by:
getVolume
in interfaceConstAaBox
- Returns:
- the volume
-
isValid
public boolean isValid()Test whether the box is valid. It is unaffected.- Specified by:
isValid
in interfaceConstAaBox
- Returns:
true
if valid, otherwisefalse
-