java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.ConvexShapeSettings
com.github.stephengold.joltjni.BoxShapeSettings
- All Implemented Interfaces:
ConstBoxShapeSettings,ConstConvexShapeSettings,ConstJoltPhysicsObject,ConstSerializableObject,ConstShapeSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
BoxShape.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.BoxShapeSettings(float radius) Instantiate a shape with the specified half extent.BoxShapeSettings(float xHalfExtent, float yHalfExtent, float zHalfExtent) Instantiate a shape with the specified half extents.BoxShapeSettings(ConstBoxShapeSettings original) Instantiate a copy of the specified settings.BoxShapeSettings(Vec3Arg halfExtents) Instantiate settings for the specified half extents.BoxShapeSettings(Vec3Arg halfExtents, float convexRadius) Instantiate settings for the specified half extents and convex radius.BoxShapeSettings(Vec3Arg halfExtents, float convexRadius, ConstPhysicsMaterial material) Instantiate settings for the specified half extents, convex radius, and material. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the convex radius.Copy the extent of the box.voidsetConvexRadius(float radius) Alter the convex radius.voidsetHalfExtent(Vec3Arg halfExtents) Alter the extent of the box.Methods inherited from class com.github.stephengold.joltjni.ConvexShapeSettings
getDensity, getMaterial, setDensity, setMaterialMethods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, cloneShapeSettings, create, getRefCount, setEmbedded, setVirtualAddressAsCoOwner, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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.ConstConvexShapeSettings
getDensity, getMaterialMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRttiMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstShapeSettings
create, getRefCount, toRefC
-
Constructor Details
-
BoxShapeSettings
public BoxShapeSettings()Instantiate default settings. -
BoxShapeSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
BoxShapeSettings
public BoxShapeSettings(float radius) Instantiate a shape with the specified half extent.- Parameters:
radius- the desired half extent (≥0.05)
-
BoxShapeSettings
public BoxShapeSettings(float xHalfExtent, float yHalfExtent, float zHalfExtent) Instantiate a shape with the specified half extents.- Parameters:
xHalfExtent- the desired half extents on the local X axis (≥0.05)yHalfExtent- the desired half extents on the local Y axis (≥0.05)zHalfExtent- the desired half extents on the local Z axis (≥0.05)
-
BoxShapeSettings
Instantiate settings for the specified half extents.- Parameters:
halfExtents- the desired half extents on each local axis (not null, all components ≥0, unaffected)
-
BoxShapeSettings
Instantiate settings for the specified half extents and convex radius.- Parameters:
halfExtents- the desired half extents on each local axis (not null, all components ≥0, unaffected)convexRadius- the desired convex radius (≥0, default=0.05)
-
BoxShapeSettings
Instantiate settings for the specified half extents, convex radius, and material.- Parameters:
halfExtents- the desired half extents on each local axis (not null, all components ≥0, unaffected)convexRadius- the desired convex radius (≥0, default=0.05)material- the desired surface properties (not null, unaffected) ornullfor default properties (default=null)
-
-
Method Details
-
setConvexRadius
public void setConvexRadius(float radius) Alter the convex radius. (native attribute: mConvexRadius)- Parameters:
radius- the desired convex radius (≥0, default=0.05)
-
setHalfExtent
Alter the extent of the box. (native attribute: mHalfExtent)- Parameters:
halfExtents- the desired half extents on each local axis (not null, all components ≥0, unaffected, default=(0,0,0))
-
getConvexRadius
public float getConvexRadius()Return the convex radius. The settings are unaffected. (native attribute: mConvexRadius)- Specified by:
getConvexRadiusin interfaceConstBoxShapeSettings- Returns:
- the convex radius (≥0)
-
getHalfExtent
Copy the extent of the box. The settings are unaffected. (native attribute: mHalfExtent)- Specified by:
getHalfExtentin interfaceConstBoxShapeSettings- Returns:
- a new vector: one-half of the extent on each local axis
-