Package com.github.stephengold.joltjni
Class StateRecorder
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.StateRecorder
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
- 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.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.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 the value of the specified vector.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
isValidating
public boolean isValidating()Test whether the recorder is validating.- Returns:
- true if validating, otherwise false
-
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
-
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
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 vector.- Parameters:
v- the vector to write (not null, unaffected)
-