java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.BodyIdArray
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A fixed-length array of body IDs. (native type:
BodyID[]
)-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
BodyIdArray
public BodyIdArray(int length) Instantiate an array with the specified length.- Parameters:
length
- the desired number of IDs (≥0)
-
-
Method Details
-
get
public int get(int elementIndex) Return the ID at the specified index.- Parameters:
elementIndex
- the index from which to copy the ID (≥0)- Returns:
- the
BodyID
value
-
set
public void set(int elementIndex, int bodyId) Store the specified ID at the specified index.- Parameters:
elementIndex
- the index at which to store the ID (≥0)bodyId
- the ID to store
-