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. |
|
|
ClearAccumulatedData() |
CONTEXT: GAMETHREAD Returns a new unmanaged allocation of the data saved on the handle, otherwise nullptr CONTEXT: GAMETHREAD -> to -> PHYSICSTHREAD Called on the game thread when the solver is about to advance forward. |
|
|
EPhysicsProx... |
ConcreteType() |
Returns the concrete type of the derived class |
|
CreateRigidBodyCallback ( |
||
|
DisableCollisionsCallback |
||
|
EndFrameCallback ( |
||
|
Chaos::FRigi... |
GetTransform() |
|
|
void * |
GetUserData() |
|
|
IsDirty() |
||
|
IsSimulating() |
Previously callback related functions, all called in the context of the physics thread if enabled. |
|
|
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. |
|
|
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 |
|
FParticlesType |
|
FParticleType |