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 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 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, cloneShapeSettings, create, getRefCount, setEmbedded, toRef, toRefC
Methods inherited from class com.github.stephengold.joltjni.SerializableObject
getRtti
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.ConstConvexShapeSettings
getDensity, getMaterial
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstShapeSettings
create, 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 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
-
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:
getConvexRadius
in interfaceConstBoxShapeSettings
- Returns:
- the convex radius (≥0)
-
getHalfExtent
Copy the extent of the box. The settings are unaffected. (native attribute: mHalfExtent)- Specified by:
getHalfExtent
in interfaceConstBoxShapeSettings
- Returns:
- a new vector: one-half of extent on each local axis
-