java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Shape
com.github.stephengold.joltjni.CompoundShape
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstShape
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
MutableCompoundShape
,StaticCompoundShape
A
Shape
composed from a union of simpler sub-shapes.-
Method Summary
Modifier and TypeMethodDescriptionint
Count the sub-shapes.getSubShape
(int subShapeIndex) Access the specified sub-shape.SubShape[]
Access all the sub-shapes as an array.void
restoreSubShapeState
(ShapeList subshapes) Restore the sub-shape references after invokingsRestoreFromBinaryState()
.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
-
Method Details
-
getNumSubShapes
public int getNumSubShapes()Count the sub-shapes.- Returns:
- the count (≥0)
-
getSubShape
Access the specified sub-shape.- Parameters:
subShapeIndex
- the index of the sub-shape (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSubShapes
Access all the sub-shapes as an array.- Returns:
- a new array of new JVM objects with pre-existing native objects assigned
-
restoreSubShapeState
Restore the sub-shape references after invokingsRestoreFromBinaryState()
.- Parameters:
subshapes
- the desired sub-shape references (not null)
-