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 TypeMethodDescriptionboolean
Test whether the recorder is validating.void
readBodyIdVector
(BodyIdVector storeResult) Read an ID vector.boolean
readBoolean
(boolean b) Read a boolean.float
readFloat
(float f) Read a single-precision floating-point value.int
readInt
(int i) Read a 32-bit integer value.void
readRMat44
(RMat44 inOut) Read a matrix.void
Read a location vector.readString
(String javaString) Read a string of text.void
Read a vector.void
setValidating
(boolean setting) Alter whether the recorder is validating.void
write
(boolean b) Write the specified boolean value.void
write
(float f) Write the specified single-precision floating-point value.void
write
(int i) Write the specified 32-bit integer value.void
write
(BodyIdVector vector) Write the specified ID vector.void
Write the value of the specified matrix.void
Write the value of the specified vector.void
Write the value of the specified vector.void
Write the specified text string.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
isValidating
public boolean isValidating()Test whether the recorder is validating.- Returns:
true
if 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
-true
to begin validating,false
to 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)
-