java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.StateRecorder
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
StateRecorderImpl
Record the state of a physics system. Can also compare against an expected
state.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether the recorder is validating.voidreadBodyIdVector(BodyIdVector storeResult) Read an ID vector.booleanreadBoolean(boolean b) Read a boolean.floatreadFloat(float f) Read a single-precision floating-point value.intreadInt(int i) Read a 32-bit integer value.voidreadRMat44(RMat44 inOut) Read a matrix.voidRead a location vector.readString(String javaString) Read a string of text.voidRead a vector.voidsetValidating(boolean setting) Alter whether the recorder is validating.voidwrite(boolean b) Write the specified boolean value.voidwrite(float f) Write the specified single-precision floating-point value.voidwrite(int i) Write the specified 32-bit integer value.voidwrite(BodyIdVector vector) Write the specified ID vector.voidWrite the value of the specified matrix.voidWrite the value of the specified vector.voidWrite the value of the specified vector.voidWrite the specified text string.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
isValidating
public boolean isValidating()Test whether the recorder is validating.- Returns:
trueif validating, otherwisefalse
-
readBodyIdVector
Read an ID vector.- Parameters:
storeResult- storage for the result (not null, modified)
-
readBoolean
public boolean readBoolean(boolean b) Read a boolean.- Parameters:
b- the value for validation- Returns:
- the value that was read
-
readFloat
public float readFloat(float f) Read a single-precision floating-point value.- Parameters:
f- the value for validation- Returns:
- the value that was read
-
readInt
public int readInt(int i) Read a 32-bit integer value.- Parameters:
i- the value for validation- Returns:
- the value that was read
-
readRMat44
Read a matrix.- Parameters:
inOut- the value for validation (not null, modified)
-
readRVec3
Read a location vector.- Parameters:
inOut- the value for validation (not null, modified)
-
readString
Read a string of text.- Parameters:
javaString- the value for validation (not null)- Returns:
- the string that was read
-
readVec3
Read a vector.- Parameters:
inOut- the value for validation (not null, modified)
-
setValidating
public void setValidating(boolean setting) Alter whether the recorder is validating.- Parameters:
setting-trueto begin validating,falseto stop validating
-
write
Write the specified ID vector.- Parameters:
vector- the vector to write (not null, unaffected)
-
write
public void write(boolean b) Write the specified boolean value.- Parameters:
b- the value to write
-
write
public void write(float f) Write the specified single-precision floating-point value.- Parameters:
f- the value to write
-
write
public void write(int i) Write the specified 32-bit integer value.- Parameters:
i- the value to write
-
write
Write the value of the specified matrix.- Parameters:
matrix- the matrix to write (not null, unaffected)
-
write
Write the value of the specified vector.- Parameters:
v- the vector to write (not null, unaffected)
-
write
Write the specified text string.- Parameters:
javaString- the string to write (not null)
-
write
Write the value of the specified vector.- Parameters:
v- the vector to write (not null, unaffected)
-