java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.ConvexShape
com.github.stephengold.joltjni.BoxShape
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstShape
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
A
Shape
to represent centered, axis-aligned rectangular solids.-
Constructor Summary
ConstructorsConstructorDescriptionBoxShape
(float halfExtent) Instantiate a cubic shape with the specified half extents.BoxShape
(float xHalfExtent, float yHalfExtent, float zHalfExtent) Instantiate a shape with the specified half extents.Instantiate a shape with the specified half extents.Instantiate a shape with the specified half extents and convex radius.BoxShape
(Vec3Arg halfExtents, float convexRadius, ConstPhysicsMaterial material) Instantiate a shape with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the convex radius.Copy the half extents.Methods inherited from class com.github.stephengold.joltjni.ConvexShape
getDensity, getSupportFunction, setDensity
Methods inherited from class com.github.stephengold.joltjni.Shape
copyDebugTriangles, countDebugTriangles, draw, drawGetSupportFunction, getCenterOfMass, getInnerRadius, getLeafShape, getLocalBounds, getMassProperties, getMaterial, getRefCount, getRevisionCount, getStats, getSubShapeIdBitsRecursive, getSubType, getType, getWorldSpaceBounds, getWorldSpaceBounds, isValidScale, makeScaleValid, mustBeStatic, saveBinaryState, setEmbedded, sRestoreFromBinaryState, 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
-
BoxShape
public BoxShape(float halfExtent) Instantiate a cubic shape with the specified half extents.- Parameters:
halfExtent
- the desired half extents (≥0.05)
-
BoxShape
public BoxShape(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)
-
BoxShape
Instantiate a shape with the specified half extents.- Parameters:
halfExtents
- the desired half extents on each local axis (not null, all components ≥0.05, unaffected)
-
BoxShape
Instantiate a shape with the specified half extents and convex radius.- Parameters:
halfExtents
- the desired half extents on each local axis (not null, all components ≥convexRadius, unaffected)convexRadius
- the desired convex radius (default=0.05)
-
BoxShape
Instantiate a shape with the specified parameters.- Parameters:
halfExtents
- the desired half extents on each local axis (not null, all components ≥convexRadius, unaffected)convexRadius
- the desired convex radius (default=0.05)material
- the desired material (default=null)
-
-
Method Details
-
getConvexRadius
public float getConvexRadius()Return the convex radius. The shape is unaffected.- Returns:
- the radius (≥0)
-
getHalfExtent
Copy the half extents. The shape is unaffected.- Returns:
- a new vector
-