Package com.github.stephengold.joltjni
Class AaBox
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.AaBox
- All Implemented Interfaces:
ConstAaBox,ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
An axis-aligned box. (native type: AABox)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether the box contains the specified point.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.floatReturn the volume of the box.booleanisValid()Test whether the box is valid.static AaBoxsBiggest()Instantiate the biggest finite box.voidsetEmpty()Alter the box to be empty.voidAlter the maximum coordinates.voidAlter the minimum coordinates.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
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)
-
-
Method Details
-
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)
-
contains
Test whether the box contains the specified point. The box is unaffected.- Specified by:
containsin interfaceConstAaBox- Parameters:
point- the point to test (not null, unaffected)- Returns:
- true if contained, otherwise false
-
getCenter
Locate the center of the box. The box is unaffected.- Specified by:
getCenterin interfaceConstAaBox- Returns:
- a new location vector
-
getExtent
Copy the (half) extent of the box. The box is unaffected.- Specified by:
getExtentin interfaceConstAaBox- Returns:
- a new vector
-
getMax
Copy the maximum contained coordinate on each axis. The box is unaffected. (native attribute: mMax)- Specified by:
getMaxin interfaceConstAaBox- Returns:
- a new vector
-
getMin
Copy the minimum contained coordinate on each axis. The box is unaffected. (native attribute: mMin)- Specified by:
getMinin interfaceConstAaBox- Returns:
- a new vector
-
getSize
Copy the size (full extent) on each axis. The box is unaffected.- Specified by:
getSizein interfaceConstAaBox- Returns:
- a new vector
-
getVolume
public float getVolume()Return the volume of the box. The box is unaffected.- Specified by:
getVolumein interfaceConstAaBox- Returns:
- the volume
-
isValid
public boolean isValid()Test whether the box is valid. It is unaffected.- Specified by:
isValidin interfaceConstAaBox- Returns:
- true if valid, otherwise false
-