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.getSubShapeIdFromIndex
(int subShapeIndex, SubShapeIdCreator parent) Convert a sub-shape index to a sub-shape ID.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, scaleShape, setEmbedded, sRestoreFromBinaryState, toRef, toRefC
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, 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 a subshape within the current compound shape (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getSubShapeIdFromIndex
Convert a sub-shape index to a sub-shape ID. (native method: GetSubShapeIDFromIndex)- Parameters:
subShapeIndex
- the index of a subshape within the current compound shape (≥0)parent
- a path the the current compound shape (not null, unaffected)- Returns:
- a new object
-
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)
-