Package com.github.stephengold.joltjni
Class TransformedShapeArray
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.TransformedShapeArray
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A fixed-length array of coordinate-transformed shapes. (native type:
TransformedShape[])-
Constructor Summary
ConstructorsConstructorDescriptionTransformedShapeArray(int length) Instantiate an array with the specified length. -
Method Summary
Modifier and TypeMethodDescriptionget(int elementIndex) Access the shape at the specified index.intlength()Return the length of the array.voidset(int elementIndex, ConstTransformedShape shape) Store the specified shape at the specified index.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
TransformedShapeArray
public TransformedShapeArray(int length) Instantiate an array with the specified length.- Parameters:
length- the desired number of shapes (>0)
-
-
Method Details
-
get
Access the shape at the specified index.- Parameters:
elementIndex- the index (≥0, <length)- Returns:
- a new JVM object with the pre-existing native object assigned
-
length
public int length()Return the length of the array.- Returns:
- the length (in shapes, >0)
-
set
Store the specified shape at the specified index.- Parameters:
elementIndex- the index at which to store the shape (≥0, <length)shape- the shape to store (notnull, unaffected)
-