Module |
|
Header |
/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/SimCallbackObject.h |
Include |
#include "Chaos/SimCallbackObject.h" |
class ISimCallbackObject
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.
Name | Description | ||
---|---|---|---|
|
CurrentOutput_Internal |
Name | Description | |
---|---|---|
|
ISimCallbackObject() |
|
|
ISimCallbackObject ( |
Name | Description | |
---|---|---|
|
~ISimCallbackObject() |
Destructor called on internal thread. |
Name | Description | ||
---|---|---|---|
|
ContactModification_Internal ( |
||
|
FinalizeOutputData_Internal() |
||
|
FreeInputData_Internal ( |
Free the input data. |
|
|
FreeOutputData_External ( |
Free the output data. |
|
|
const FSimCa... |
GetCurrentInput_Internal() |
|
|
GetDeltaTime_Internal() |
The delta time associated with this simulation step |
|
|
FSimCallback... |
GetProducerInputData_External() |
Gets the current producer input data. This is what the external thread should be writing to |
|
GetSimTime_Internal() |
The point in time when this simulation step begins |
|
|
FPhysicsSolv... |
GetSolver() |
|
|
IsFAsyncObjectManagerCallback() |
||
|
PreSimulate_Internal() |
||
|
SetCurrentInput_Internal ( |
||
|
SetSimAndDeltaTime_Internal |