- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A variable-length vector (array) of bodies. (native type:
Array<Body *>)-
Method Summary
Modifier and TypeMethodDescriptionintcapacity()Count how many bodies the currently allocated storage can hold.voiderase(int startIndex, int stopIndex) Remove all bodies in the specified range of indices.get(int elementIndex) Access the body at the specified index.Access the underlyingBodyManager.voidresize(int numBodies) Expand or truncate the vector.voidPut the specified body at the specified index.intsize()Count how many bodies are in the vector.Methods inherited from class com.github.stephengold.joltjni.template.Array
clear, empty, erase, pushBack, toListMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getManager
Access the underlyingBodyManager.- Returns:
- the pre-existing instance (not null)
-
capacity
public int capacity()Count how many bodies the currently allocated storage can hold. The vector is unaffected. -
erase
public void erase(int startIndex, int stopIndex) Remove all bodies in the specified range of indices. -
get
Access the body at the specified index. -
resize
public void resize(int numBodies) Expand or truncate the vector. -
set
Put the specified body at the specified index. -
size
public int size()Count how many bodies are in the vector. The vector is unaffected.
-