Class StateRecorder

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
StateRecorderImpl

public class StateRecorder extends NonCopyable
Record the state of a physics system. Can also compare against an expected state.
  • Method Details

    • isValidating

      public boolean isValidating()
      Test whether the recorder is validating.
      Returns:
      true if validating, otherwise false
    • readBodyIdVector

      public void readBodyIdVector(BodyIdVector storeResult)
      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

      public void readRMat44(RMat44 inOut)
      Read a matrix.
      Parameters:
      inOut - the value for validation (not null, modified)
    • readRVec3

      public void readRVec3(RVec3 inOut)
      Read a location vector.
      Parameters:
      inOut - the value for validation (not null, modified)
    • readString

      public String readString(String javaString)
      Read a string of text.
      Parameters:
      javaString - the value for validation (not null)
      Returns:
      the string that was read
    • readVec3

      public void readVec3(Vec3 inOut)
      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(BodyIdVector vector)
      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

      public void write(RMat44Arg matrix)
      Write the value of the specified matrix.
      Parameters:
      matrix - the matrix to write (not null, unaffected)
    • write

      public void write(RVec3Arg v)
      Write the value of the specified vector.
      Parameters:
      v - the vector to write (not null, unaffected)
    • write

      public void write(String javaString)
      Write the specified text string.
      Parameters:
      javaString - the string to write (not null)
    • write

      public void write(Vec3Arg v)
      Write the value of the specified vector.
      Parameters:
      v - the vector to write (not null, unaffected)