- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A variable-length list (array) of shapes. (native type:
Array<RefConst<Shape>>
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
Count how many shapes the currently allocated storage can hold.void
erase
(int startIndex, int stopIndex) Remove all shapes in the specified range of indices.get
(int elementIndex) Access the shape at the specified index.void
resize
(int numElements) Expand or truncate the list.void
Put a reference to the specified shape at the specified index.int
size()
Count how many shapes are in the list.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
-
Constructor Details
-
ShapeList
public ShapeList()Instantiate an empty list. -
ShapeList
Instantiate a list containing a single shape.- Parameters:
shapeRef
- a counted reference to the desired shape (not null)
-
-
Method Details
-
capacity
public int capacity()Count how many shapes the currently allocated storage can hold. The list is unaffected. -
erase
public void erase(int startIndex, int stopIndex) Remove all shapes in the specified range of indices. -
get
Access the shape at the specified index. -
resize
public void resize(int numElements) Expand or truncate the list. -
set
Put a reference to the specified shape at the specified index. -
size
public int size()Count how many shapes are in the list. The list is unaffected.
-