- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A variable-length vector (array) of bodies. (native type:
Array<Body *>
)-
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
Count how many bodies the currently allocated storage can hold.void
erase
(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
.void
resize
(int numBodies) Expand or truncate the vector.void
Put the specified body at the specified index.int
size()
Count how many bodies are in the vector.Methods inherited from class com.github.stephengold.joltjni.template.Array
clear, empty, erase, pushBack, toList
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, 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.
-