- All Implemented Interfaces:
ConstConvexShapeSettings
,ConstJoltPhysicsObject
,ConstShapeSettings
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
BoxShape
.-
Constructor Summary
ConstructorsConstructorDescriptionBoxShapeSettings
(float xHalfExtent, float yHalfExtent, float zHalfExtent) Instantiate a shape with the specified half extents.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 TypeMethodDescriptionfloat
Return the convex radius.Copy the extent of the box.void
setConvexRadius
(float radius) Alter the convex radius.void
setHalfExtent
(Vec3Arg halfExtents) Alter the extent of the box.Methods inherited from class com.github.stephengold.joltjni.ConvexShapeSettings
getDensity, getMaterial, setDensity, setMaterial
Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, create, getRefCount, setEmbedded, toRef, toRefC
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
-
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) ornull
for 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))
-