Navigation
API > API/Runtime > API/Runtime/Chaos > API/Runtime/Chaos/Chaos
Inheritance Hierarchy
- ISimCallbackObject
- FSimCallbackCommandObject
- TSimCallbackObject
- FBuoyancyManagerAsyncCallback
- FChaosSceneSimCallback
- FChaosVehicleManagerAsyncCallback
- FCharacterMovementComponentAsyncCallback
- FPhysicsReplicationAsync
- TUserDataManagerPT
References
| Module | Chaos |
| Header | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/SimCallbackObject.h |
| Include | #include "Chaos/SimCallbackObject.h" |
Syntax
class ISimCallbackObject
Remarks
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.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FSimCallbackOutput * | CurrentOutput_Internal |
Constructors
| Type | Name | Description | |
|---|---|---|---|
ISimCallbackObject
(
const ISimCallbackObject& |
|||
ISimCallbackObject
(
const ESimCallbackOptions InOptions |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Destructor called on internal thread. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyCorrections_Internal
(
int32 PhysicsStep, |
||
| void | CCDModification_Internal
(
FCCDModifierAccessor& Modifier |
||
| void | ContactModification_Internal
(
FCollisionContactModifier& Modifier |
||
| void | |||
| void | FirstPreResimStep_Internal
(
int32 PhysicsStep |
||
| void | FreeInputData_Internal
(
FSimCallbackInput* Input |
Free the input data. | |
| void | FreeOutputData_External
(
FSimCallbackOutput* Output |
Free the output data. | |
| const FSimCallbackInput * | |||
| FReal | The delta time associated with this simulation step | ||
| FName | Get a stat name to describe this callback in external profiling and STATS when Named events are enabled | ||
| FSimCallbackInput * | Gets the current producer input data. This is what the external thread should be writing to | ||
| FReal | The point in time when this simulation step begins | ||
| const FPhysicsSolverBase * | GetSolver () |
||
| FPhysicsSolverBase * | GetSolver () |
||
| bool | HasOption
(
const ESimCallbackOptions Option |
||
| void | InjectInputs_External
(
int32 PhysicsStep, |
Rewind API. | |
| bool | |||
| void | MidPhaseModification_Internal
(
FMidPhaseModifierAccessor& Modifier |
||
| void | |||
| void | ProcessInputs_External
(
int32 PhysicsStep |
||
| void | ProcessInputs_Internal
(
int32 PhysicsStep |
||
| void | SetCurrentInput_Internal
(
FSimCallbackInput* NewInput |
||
| void | SetSimAndDeltaTime_Internal
(
const FReal InSimTime, |
||
| void | StrainModification_Internal
(
FStrainModifierAccessor& Modifier |
||
| int32 | TriggerRewindIfNeeded_Internal
(
int32 LastCompletedStep |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Use HasOption(ESimCallbackOptions::RunOnFrozenGameThread) instead. |