TPhysicsProxy

Base object interface for solver objects.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/PhysicsProxy.h

Include

#include "Chaos/Framework/PhysicsProxy.h"

Syntax

template<class Concrete, class ConcreteData>
class TPhysicsProxy : public IPhysicsProxyBase

Remarks

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

Constructors

Name Description

Public function

TPhysicsProxy()

Public function

TPhysicsProxy

(
    UObject* InOwner
)

Destructors

Name Description

Public function Virtual

~TPhysicsProxy()

Virtual destructor for derived objects, ideally no other virtuals should exist in this chain

Functions

Name Description

Public function

void

 

AddForceCallback

(
    FParticlesType& InParticles,
    const Chaos::FReal InDt,
    const int32 InIndex
)

Public function

void

 

BindParticleCallbackMapping

The Particle Binding creates a connection between the particles in the simulation and the solver objects dataset.

Public function

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.

Public function

EPhysicsProx...

 

ConcreteType()

Returns the concrete type of the derived class

Public function

void

 

CreateRigidBodyCallback

(
    FParticlesType& InOutParticles
)

Public function

void

 

DisableCollisionsCallback

(
    TSet< TTuple< int32, int32 >>& InP...
)

Public function

void

 

EndFrameCallback

(
    const Chaos::FReal InDt
)

Public function Const

Chaos::FRigi...

 

GetTransform()

Public function Const

void *

 

GetUserData()

Public function

bool

 

IsDirty()

Public function Const

bool

 

IsSimulating()

Previously callback related functions, all called in the context of the physics thread if enabled.

Public function

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.

Public function

void

 

StartFrameCallback

(
    const Chaos::FReal InDt,
    const Chaos::FReal InTime
)

Public function

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

Public function

void

 

UpdateKinematicBodiesCallback

(
    const FParticlesType& InParticles,
    const Chaos::FReal InDt,
    const Chaos::FReal InTime,
    FKinematicProxy& InKinematicProxy
)

Overridden from IPhysicsProxyBase

Name Description

Public function Virtual Const

UObject *...

 

GetOwner()

Gets the owning external object for this solver object, never used internally

Typedefs

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss