Navigation
API > API/Runtime > API/Runtime/Chaos
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
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 | TPhysicsProxy |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/PhysicsProxy.h |
| Include Path | #include "Chaos/Framework/PhysicsProxy.h" |
Syntax
template<class Concrete, class ConcreteData, typename TProxyTimeStamp>
class TPhysicsProxy : public IPhysicsProxyBase
Implements Interfaces
Derived Classes
- FClusterUnionPhysicsProxy
- FGeometryCollectionPhysicsProxy
- FSkeletalMeshPhysicsProxy
- FStaticMeshPhysicsProxy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Chaos/Framework/PhysicsProxy.h | |||
TPhysicsProxy
(
UObject* InOwner |
Chaos/Framework/PhysicsProxy.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~TPhysicsProxy() |
Virtual destructor for derived objects, ideally no other virtuals should exist in this chain | Chaos/Framework/PhysicsProxy.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FIntArray | Chaos::TArrayCollectionArray< int32 > | Chaos/Framework/PhysicsProxy.h | |
| FParticlesType | Chaos::FPBDRigidParticles | Chaos/Framework/PhysicsProxy.h | |
| FParticleType | Concrete | Chaos/Framework/PhysicsProxy.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddForceCallback
(
FParticlesType& InParticles, |
Chaos/Framework/PhysicsProxy.h | ||
void BindParticleCallbackMapping
(
Chaos::TArrayCollectionArray< PhysicsProxyWrapper >& PhysicsProxyReverseMap, |
The Particle Binding creates a connection between the particles in the simulation and the solver objects dataset. | Chaos/Framework/PhysicsProxy.h | |
void 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. | Chaos/Framework/PhysicsProxy.h | |
void CreateRigidBodyCallback
(
FParticlesType& InOutParticles |
Chaos/Framework/PhysicsProxy.h | ||
void DisableCollisionsCallback
(
TSet< TTuple< int32, int32 > >& InPairs |
Chaos/Framework/PhysicsProxy.h | ||
void EndFrameCallback
(
const float InDt |
Chaos/Framework/PhysicsProxy.h | ||
TProxyTimeStamp & GetSyncTimestampTyped() |
Chaos/Framework/PhysicsProxy.h | ||
Chaos::FRigidTransform3 GetTransform() |
Chaos/Framework/PhysicsProxy.h | ||
void * GetUserData() |
Chaos/Framework/PhysicsProxy.h | ||
bool IsDirty() |
Chaos/Framework/PhysicsProxy.h | ||
bool IsSimulating () |
Previously callback related functions, all called in the context of the physics thread if enabled. | Chaos/Framework/PhysicsProxy.h | |
void 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. | Chaos/Framework/PhysicsProxy.h | |
void StartFrameCallback
(
const float InDt, |
Chaos/Framework/PhysicsProxy.h | ||
void 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 | Chaos/Framework/PhysicsProxy.h | |
void UpdateKinematicBodiesCallback
(
const FParticlesType& InParticles, |
Chaos/Framework/PhysicsProxy.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static EPhysicsProxyType ConcreteType() |
Returns the concrete type of the derived class | Chaos/Framework/PhysicsProxy.h |