UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::IRewindCallback Class Reference

#include <RewindData.h>

+ Inheritance diagram for Chaos::IRewindCallback:

Public Member Functions

virtual ~IRewindCallback ()=default
 
virtual void ProcessInputs_Internal (int32 PhysicsStep, const TArray< FSimCallbackInputAndObject > &SimCallbackInputs)
 
virtual void ApplyCallbacks_Internal (int32 PhysicsStep, const TArray< ISimCallbackObject * > &SimCallbackObjects)
 
virtual void ProcessInputs_External (int32 PhysicsStep, const TArray< FSimCallbackInputAndObject > &SimCallbackInputs)
 
virtual void InjectInputs_External (int32 PhysicsStep, int32 NumSteps)
 
virtual int32 TriggerRewindIfNeeded_Internal (int32 LatestStepCompleted)
 
virtual void PreResimStep_Internal (int32 PhysicsStep, bool bFirstStep)
 
virtual void PostResimStep_Internal (int32 PhysicsStep)
 
virtual void RegisterRewindableSimCallback_Internal (ISimCallbackObject *Callback)
 
virtual void UnregisterRewindableSimCallback_Internal (ISimCallbackObject *Callback)
 
virtual void SetResimDebugInfo_Internal (const FResimDebugInfo &ResimDebugInfo)
 

Public Attributes

Chaos::FRewindDataRewindData = nullptr
 

Detailed Description

Used by user code to determine when rewind should occur and gives it the opportunity to record any additional data

Constructor & Destructor Documentation

◆ ~IRewindCallback()

virtual Chaos::IRewindCallback::~IRewindCallback ( )
virtualdefault

Member Function Documentation

◆ ApplyCallbacks_Internal()

virtual void Chaos::IRewindCallback::ApplyCallbacks_Internal ( int32  PhysicsStep,
const TArray< ISimCallbackObject * > &  SimCallbackObjects 
)
inlinevirtual

Called after any presim callbacks are triggered and after physics data has marshalled over in order to modify the sim callback outputs

◆ InjectInputs_External()

virtual void Chaos::IRewindCallback::InjectInputs_External ( int32  PhysicsStep,
int32  NumSteps 
)
inlinevirtual

Called before inputs are split into potential sub-steps and marshalled over to the physics thread. The physics state has not been applied yet, and cannot be inspected anyway because this is triggered from the external thread (game thread) Gives user the ability to call GetProducerInputData_External one last time. Input data is shared amongst sub-steps. If NumSteps > 1 it means any input data injected will be shared for all sub-steps generated

Reimplemented in FAsyncPhysicsInputRewindCallback, and FNetworkPhysicsCallback.

◆ PostResimStep_Internal()

virtual void Chaos::IRewindCallback::PostResimStep_Internal ( int32  PhysicsStep)
inlinevirtual

Called after each rewind step. This is to give user code the opportunity to trigger other code after each rewind step Usually to simulate external systems that ran in lock step with the physics sim

Reimplemented in FNetworkPhysicsCallback.

◆ PreResimStep_Internal()

virtual void Chaos::IRewindCallback::PreResimStep_Internal ( int32  PhysicsStep,
bool  bFirstStep 
)
inlinevirtual

Called before each rewind step. This is to give user code the opportunity to trigger other code before each rewind step Usually to simulate external systems that ran in lock step with the physics sim

Reimplemented in FNetworkPhysicsCallback.

◆ ProcessInputs_External()

virtual void Chaos::IRewindCallback::ProcessInputs_External ( int32  PhysicsStep,
const TArray< FSimCallbackInputAndObject > &  SimCallbackInputs 
)
inlinevirtual

Called before any inputs are marshalled over to the physics thread. The physics state has not been applied yet, and cannot be inspected anyway because this is triggered from the external thread (game thread) Gives user the ability to modify inputs or record them - this can help with reducing latency if you want to act on inputs immediately

Reimplemented in FAsyncPhysicsInputRewindCallback, and FNetworkPhysicsCallback.

◆ ProcessInputs_Internal()

virtual void Chaos::IRewindCallback::ProcessInputs_Internal ( int32  PhysicsStep,
const TArray< FSimCallbackInputAndObject > &  SimCallbackInputs 
)
inlinevirtual

Called before any sim callbacks are triggered but after physics data has marshalled over This means brand new physics particles are already created for example, and any pending game thread modifications have happened See ISimCallbackObject for recording inputs to callbacks associated with this PhysicsStep

Reimplemented in FNetworkPhysicsCallback.

◆ RegisterRewindableSimCallback_Internal()

virtual void Chaos::IRewindCallback::RegisterRewindableSimCallback_Internal ( ISimCallbackObject Callback)
inlinevirtual

Register a sim callback onto the rewind callback

Reimplemented in FNetworkPhysicsCallback.

◆ SetResimDebugInfo_Internal()

virtual void Chaos::IRewindCallback::SetResimDebugInfo_Internal ( const FResimDebugInfo ResimDebugInfo)
inlinevirtual

Called When resim is finished with debug information about the resim

◆ TriggerRewindIfNeeded_Internal()

virtual int32 Chaos::IRewindCallback::TriggerRewindIfNeeded_Internal ( int32  LatestStepCompleted)
inlinevirtual

Called after sim step to give the option to rewind. Any pending inputs for the next frame will remain in the queue Return the PhysicsStep to start resimulating from. Resim will run up until latest step passed into RecordInputs (i.e. latest physics sim simulated so far) Return INDEX_NONE to indicate no rewind

Reimplemented in FAsyncPhysicsInputRewindCallback, and FNetworkPhysicsCallback.

◆ UnregisterRewindableSimCallback_Internal()

virtual void Chaos::IRewindCallback::UnregisterRewindableSimCallback_Internal ( ISimCallbackObject Callback)
inlinevirtual

Unregister a sim callback from the rewind callback

Reimplemented in FNetworkPhysicsCallback.

Member Data Documentation

◆ RewindData

Chaos::FRewindData* Chaos::IRewindCallback::RewindData = nullptr

Rewind Data holding the callback


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