Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
StateRecorder Class Reference

#include <StateRecorder.h>

Inheritance diagram for StateRecorder:
StreamIn StreamOut StateRecorderImpl

Public Member Functions

 StateRecorder ()=default
 Constructor. More...
 
 StateRecorder (const StateRecorder &inRHS)
 
void SetValidating (bool inValidating)
 
bool IsValidating () const
 
- Public Member Functions inherited from StreamIn
virtual ~StreamIn ()=default
 Virtual destructor. More...
 
virtual void ReadBytes (void *outData, size_t inNumBytes)=0
 Read a string of bytes from the binary stream. More...
 
virtual bool IsEOF () const =0
 Returns true when an attempt has been made to read past the end of the file. More...
 
virtual bool IsFailed () const =0
 Returns true if there was an IO failure. More...
 
template<class T >
void Read (T &outT)
 Read a primitive (e.g. float, int, etc.) from the binary stream. More...
 
template<class T , class A >
void Read (std::vector< T, A > &outT)
 Read a vector of primitives from the binary stream. More...
 
template<class Type , class Traits , class Allocator >
void Read (std::basic_string< Type, Traits, Allocator > &outString)
 Read a string from the binary stream (reads the number of characters and then the characters) More...
 
void Read (Vec3 &outVec)
 Read a Vec3 (don't read W) More...
 
void Read (DVec3 &outVec)
 Read a DVec3 (don't read W) More...
 
void Read (DMat44 &outVec)
 Read a DMat44 (don't read W component of translation) More...
 
- Public Member Functions inherited from StreamOut
virtual ~StreamOut ()=default
 Virtual destructor. More...
 
virtual void WriteBytes (const void *inData, size_t inNumBytes)=0
 Write a string of bytes to the binary stream. More...
 
virtual bool IsFailed () const =0
 Returns true if there was an IO failure. More...
 
template<class T >
void Write (const T &inT)
 Write a primitive (e.g. float, int, etc.) to the binary stream. More...
 
template<class T , class A >
void Write (const std::vector< T, A > &inT)
 Write a vector of primitives from the binary stream. More...
 
template<class Type , class Traits , class Allocator >
void Write (const std::basic_string< Type, Traits, Allocator > &inString)
 Write a string to the binary stream (writes the number of characters and then the characters) More...
 
void Write (const Vec3 &inVec)
 Write a Vec3 (don't write W) More...
 
void Write (const DVec3 &inVec)
 Write a DVec3 (don't write W) More...
 
void Write (const DMat44 &inVec)
 Write a DMat44 (don't write W component of translation) More...
 

Detailed Description

Class that records the state of a physics system. Can be used to check if the simulation is deterministic by putting the recorder in validation mode. Can be used to restore the state to an earlier point in time.

Constructor & Destructor Documentation

◆ StateRecorder() [1/2]

StateRecorder::StateRecorder ( )
default

Constructor.

◆ StateRecorder() [2/2]

StateRecorder::StateRecorder ( const StateRecorder inRHS)
inline

Member Function Documentation

◆ IsValidating()

bool StateRecorder::IsValidating ( ) const
inline

◆ SetValidating()

void StateRecorder::SetValidating ( bool  inValidating)
inline

Sets the stream in validation mode. In this case the physics system ensures that before it calls ReadBytes that it will ensure that those bytes contain the current state. This makes it possible to step and save the state, restore to the previous step and step again and when the recorded state is not the same it can restore the expected state and any byte that changes due to a ReadBytes function can be caught to find out which part of the simulation is not deterministic


The documentation for this class was generated from the following file: