Package com.github.stephengold.joltjni
Class BodyIdVector
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A variable-length vector (array) of body IDs. (native type:
Array<BodyID>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()Count how many IDs the currently allocated storage can hold.get(int elementIndex) Access the ID at the specified index.voidresize(int numIds) Expand or truncate the vector.voidPut the specified ID at the specified index.intsize()Count how many IDs are in the vector.Methods inherited from class com.github.stephengold.joltjni.template.Array
clear, empty, pushBack, toListMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
BodyIdVector
public BodyIdVector()Instantiate an empty vector.
-
-
Method Details
-
capacity
public int capacity()Count how many IDs the currently allocated storage can hold. The vector is unaffected. -
get
Access the ID at the specified index. -
resize
public void resize(int numIds) Expand or truncate the vector. -
set
Put the specified ID at the specified index. -
size
public int size()Count how many IDs are in the vector. The vector is unaffected.
-