![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SimCallbackObject.h>
Inheritance diagram for Chaos::ISimCallbackObject:Protected Member Functions | |
| ISimCallbackObject (const ESimCallbackOptions InOptions=ESimCallbackOptions::Presimulate) | |
| CHAOS_API FSimCallbackInput * | GetProducerInputData_External () |
| void | SetCurrentInput_Internal (FSimCallbackInput *NewInput) |
| void | SetSimAndDeltaTime_Internal (const FReal InSimTime, const FReal InDeltaTime) |
| const FSimCallbackInput * | GetCurrentInput_Internal () const |
Protected Attributes | |
| FSimCallbackOutput * | CurrentOutput_Internal |
Friends | |
| class | FPBDRigidsSolver |
| class | FPhysicsSolverBase |
| class | FChaosMarshallingManager |
| struct | FPushPhysicsData |
Callback API used for executing code at different points in the simulation. The external thread pushes input data at its own rate (typically once per game thread tick) The internal thread consumes the relevant inputs based on timestamps. For example, if a physics step is 40ms and we tick the game thread at 20ms, the callback would receive 2 inputs per callback (assuming data was pushed every game thread tick) A callback can generate one output to be consumed by the external thread. For example, you could apply a force to an object based on how close the object is to the ground. In this case the game thread may want to know how much force was applied.
This API is also used for resimulating. Because of this, the input data is const and its lifetime is maintained by the internal thread. It is expected that callbacks are "pure" in the sense that they rely only on the input data and affect the simulation in a repeatable and deterministic way. This means that if the same inputs are passed into the callback, we expect the exact same output and that any simulation changes are the same. We rely on this to cache results and skip callbacks when possible during a resim. See functions for more details.
|
virtualdefault |
|
delete |
|
inlineprotected |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
pure virtual |
Free the input data. Note that allocation is done on the external thread, but freeing is done on the internal thread. A common pattern is to use a single producer single consumer thread safe queue to manage this.
|
pure virtual |
Free the output data. Note that allocation is done on the internal thread, but freeing is done on the external thread. A common pattern is to use a single producer single consumer thread safe queue to manage this.
Implemented in Chaos::FSimCallbackCommandObject, Chaos::TSimCallbackObject< TInputType, TOutputType, TOptions >, Chaos::TSimCallbackObject< Chaos::FSimCallbackNoInput, Chaos::FSimCallbackNoOutput, Chaos::ESimCallbackOptions::Presimulate|Chaos::ESimCallbackOptions::RunOnFrozenGameThread >, Chaos::TSimCallbackObject< FAsyncNetworkPhysicsComponentInput, FAsyncNetworkPhysicsComponentOutput, Chaos::ESimCallbackOptions::PhysicsObjectUnregister >, Chaos::TSimCallbackObject< FChaosSceneCallbackInput >, Chaos::TSimCallbackObject< FCharacterMovementComponentAsyncInput, FCharacterMovementComponentAsyncOutput >, Chaos::TSimCallbackObject< FNetworkPhysicsSettingsAsyncInput, Chaos::FSimCallbackNoOutput, Chaos::ESimCallbackOptions::Presimulate >, Chaos::TSimCallbackObject< FPhysicsReplicationAsyncInput, Chaos::FSimCallbackNoOutput, Chaos::ESimCallbackOptions::Presimulate|Chaos::ESimCallbackOptions::PhysicsObjectUnregister >, Chaos::TSimCallbackObject< FPhysicsReplicationCacheAsyncInput, FPhysicsReplicationCacheAsyncOutput, Chaos::ESimCallbackOptions::Presimulate|Chaos::ESimCallbackOptions::PostSolve|Chaos::ESimCallbackOptions::PhysicsObjectUnregister >, and Chaos::TSimCallbackObject< FPhysicsReplicationLODAsyncInput, Chaos::FSimCallbackNoOutput, Chaos::ESimCallbackOptions::Presimulate|Chaos::ESimCallbackOptions::Rewind|Chaos::ESimCallbackOptions::PhysicsObjectUnregister >.
|
inlineprotected |
|
inline |
The delta time associated with this simulation step
Get a stat name to describe this callback in external profiling and STATS when Named events are enabled
Reimplemented in FAsyncPhysicsTickCallback, FCharacterMovementComponentAsyncCallback, Chaos::FSimCallbackCommandObject, and FChaosSceneSimCallback.
|
protected |
Gets the current producer input data. This is what the external thread should be writing to
|
inline |
The point in time when this simulation step begins
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Called before async inputs are marshaled over to the physics thread, only called if an async input is produced to get marshaled Register with ESimCallbackOptions::Rewind to get callback
Called before any sim callbacks are triggered but after async inputs has marshaled over Register with ESimCallbackOptions::Rewind to get callback
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inlinevirtual |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |