Package com.github.stephengold.joltjni
Class BoxShapeSettings
- All Implemented Interfaces:
ConstConvexShapeSettings,ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
Settings used to construct a
BoxShape.-
Constructor Summary
ConstructorsConstructorDescriptionBoxShapeSettings(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, create, getRefCount, setEmbedded, toRefMethods 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
-
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
-
getConvexRadius
public float getConvexRadius()Return the convex radius. The settings are unaffected. (native attribute: mConvexRadius)- Returns:
- the convex radius (≥0)
-
getHalfExtent
Copy the extent of the box. The settings are unaffected. (native attribute: mHalfExtent)- Returns:
- a new vector: one-half of extent on each local axis
-
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))
-