Interface ConstBodyId
- All Superinterfaces:
Comparable<ConstJoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Implementing Classes:
BodyId
Read-only access to a
BodyId. (native type: const BodyID)-
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a mutable copy.intgetIndex()Return the body's index in the array.intConvert the ID to an integer.intReturn the body's sequence number.booleanisEqual(ConstBodyId id2) Test whether the current ID is equal to the argument.booleanTest whether the ID is valid.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
Method Details
-
copy
BodyId copy()Create a mutable copy.- Returns:
- a new mutable JVM object with a new native object assigned
-
getIndex
int getIndex()Return the body's index in the array. The ID is unaffected.- Returns:
- the index (≥0)
-
getIndexAndSequenceNumber
int getIndexAndSequenceNumber()Convert the ID to an integer. The ID is unaffected.- Returns:
- the integer value
-
getSequenceNumber
int getSequenceNumber()Return the body's sequence number. The ID is unaffected.- Returns:
- the sequence number (≥0)
-
isEqual
Test whether the current ID is equal to the argument. The current ID is unaffected.- Parameters:
id2- the 2nd ID to test (not null, unaffected)- Returns:
- true if equal, false if unequal
-
isInvalid
boolean isInvalid()Test whether the ID is valid. It is unaffected.- Returns:
- true if invalid, false if valid
-