Module |
|
Header |
/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/PhysicsProxy.h |
Include |
#include "Chaos/Framework/PhysicsProxy.h" |
template<class Concrete, class ConcreteData>
class TPhysicsProxy : public IPhysicsProxyBase
Base object interface for solver objects. Defines the expected API for objects uses CRTP for static dispatch, entire API considered "pure-virtual" and must be* defined. Forgetting to implement any of the interface functions will give errors regarding recursion on all control paths for TPhysicsProxy<T> where T will be the type that has not correctly implemented the API.
PersistentTask uses IPhysicsProxyBase, so when implementing a new specialized type it is necessary to include its header file in PersistentTask.cpp allowing the linker to properly resolve the new type.
May not be necessary overall once the engine has solidified - we can just use the final concrete objects but this gives us almost the same flexibility as the old callbacks while solving most of the drawbacks (virtual dispatch, cross-object interaction)
#BG TODO - rename the callbacks functions, document for the base solver object
Name | Description | |
---|---|---|
|
TPhysicsProxy() |
|
|
TPhysicsProxy ( |
Name | Description | |
---|---|---|
|
~TPhysicsProxy() |
Virtual destructor for derived objects, ideally no other virtuals should exist in this chain |
Name | Description | ||
---|---|---|---|
|
AddForceCallback ( |
||
|
BindParticleCallbackMapping |
The Particle Binding creates a connection between the particles in the simulation and the solver objects dataset. |
|
|
BufferCommand ( |
Called to buffer a command to be processed at the next available safe opportunity |
|
|
BufferPhysicsResults() |
CONTEXT: PHYSICSTHREAD Called per-tick after the simulation has completed. |
|
|
ClearAccumulatedData() |
CONTEXT: GAMETHREAD Called on game thread after NewData has been called to buffer the particle data for physics. |
|
|
EPhysicsProx... |
ConcreteType() |
Returns the concrete type of the derived class |
|
CreateRigidBodyCallback ( |
||
|
DisableCollisionsCallback |
||
|
EndFrameCallback ( |
||
|
FieldForcesUpdateCallback ( |
||
|
FlipBuffer() |
CONTEXT: PHYSICSTHREAD (Write Locked) Called by the physics thread to signal that it is safe to perform any double-buffer flips here. |
|
|
Chaos::TRigi... |
GetTransform() |
|
|
void * |
GetUserData() |
|
|
IsDirty() |
||
|
IsSimulating() |
Previously callback related functions, all called in the context of the physics thread if enabled. |
|
|
Chaos::FPart... |
NewData() |
CONTEXT: GAMETHREAD Returns a new unmanaged allocation of the data saved on the handle, otherwise nullptr |
|
OnRemoveFromScene() |
CONTEXT: PHYSICSTHREAD Called on the physics thread when the engine is shutting down the proxy and we need to remove it from any active simulations. |
|
|
ParameterUpdateCallback ( |
||
|
PullFromPhysicsState() |
CONTEXT: GAMETHREAD (Read Locked) Perform a similar operation to Sync, but take the data from a gamethread-safe buffer. |
|
|
PushToPhysicsState ( |
CONTEXT: GAMETHREAD -> to -> PHYSICSTHREAD Called on the game thread when the solver is about to advance forward. |
|
|
StartFrameCallback ( |
||
|
SyncBeforeDestroy() |
CONTEXT: GAMETHREAD Called during the gamethread sync after the proxy has been removed from its solver intended for final handoff of any data the proxy has that the gamethread may be interested in |
|
|
UpdateKinematicBodiesCallback ( |
Name | Description | ||
---|---|---|---|
|
UObject *... |
GetOwner() |
Gets the owning external object for this solver object, never used internally |
Name |
Description |
---|---|
FCollisionConstraintsType |
|
FIntArray |
|
FParticleData |
|
FParticlesType |
|
FParticleType |