UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PhysScene_Chaos.cpp File Reference

Classes

struct  FPendingAsyncPhysicsCommand
 
class  FPhysSceneExecHandler
 
class  FAsyncPhysicsTickCallback
 
class  FSpacialDebugDraw
 
class  FPhysicsThreadSyncCaller
 
struct  FPhysScenePendingComponentTransform_Chaos
 

Functions

 DECLARE_CYCLE_STAT (TEXT("Update Kinematics On Deferred SkelMeshes"), STAT_UpdateKinematicsOnDeferredSkelMeshesChaos, STATGROUP_Physics)
 
 DEFINE_LOG_CATEGORY_STATIC (LogFPhysScene_ChaosSolver, Log, All)
 
void DumpHierarchyStats (const TArray< FString > &Args)
 
template<typename ObjectType >
void AddPhysicsProxy (ObjectType *InObject, Chaos::FPhysicsSolver *InSolver)
 
template<typename ObjectType >
void RemovePhysicsProxy (ObjectType *InObject, Chaos::FPhysicsSolver *InSolver, FChaosSolversModule *InModule)
 
template<typename T_ACTORCONTAINER , typename T_TRANSFORMCONTAINER >
void GatherActorsAndTransforms (USkeletalMeshComponent *SkelComp, const TArray< FTransform > &InComponentSpaceTransforms, ETeleportType Teleport, bool bNeedsSkinning, T_ACTORCONTAINER &KinematicUpdateActors, T_TRANSFORMCONTAINER &KinematicUpdateTransforms, T_ACTORCONTAINER &TeleportActors, T_TRANSFORMCONTAINER &TeleportTransforms)
 
void ProcessTeleportActors (FPhysScene_Chaos &Scene, const TArrayView< FPhysicsActorHandle > &ActorHandles, const TArrayView< FTransform > &Transforms)
 
void ProcessKinematicTargetActors (FPhysScene_Chaos &Scene, const TArrayView< FPhysicsActorHandle > &ActorHandles, const TArrayView< FTransform > &Transforms)
 
 DECLARE_CYCLE_STAT (TEXT("FPhysScene_Chaos::OnSyncBodies-FSingleParticlePhysicsProxy"), STAT_SyncBodiesSingleParticlePhysicsProxy, STATGROUP_Chaos)
 
 DECLARE_CYCLE_STAT_WITH_FLAGS (TEXT("FPhysScene_Chaos::OnSyncBodies-FJointConstraintPhysicsProxy"), STAT_SyncBodiesJointConstraintPhysicsProxy, STATGROUP_Chaos, EStatFlags::Verbose)
 
 DECLARE_CYCLE_STAT (TEXT("FPhysScene_Chaos::OnSyncBodies-FGeometryCollectionPhysicsProxy"), STAT_SyncBodiesGeometryCollectionPhysicsProxy, STATGROUP_Chaos)
 
 DECLARE_CYCLE_STAT (TEXT("FPhysScene_Chaos::OnSyncBodies-FClusterUnionPhysicsProxy"), STAT_SyncBodiesClusterUnionPhysicsProxy, STATGROUP_Chaos)
 

Variables

TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyEnable (TEXT("P.Chaos.DrawHierarchy.Enable"), 0, TEXT("Enable / disable drawing of the physics hierarchy"))
 
TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyCells (TEXT("P.Chaos.DrawHierarchy.Cells"), 0, TEXT("Enable / disable drawing of the physics hierarchy cells"))
 
TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyBounds (TEXT("P.Chaos.DrawHierarchy.Bounds"), 1, TEXT("Enable / disable drawing of the physics hierarchy bounds"))
 
TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyObjectBounds (TEXT("P.Chaos.DrawHierarchy.ObjectBounds"), 1, TEXT("Enable / disable drawing of the physics hierarchy object bounds"))
 
TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyCellElementThresh (TEXT("P.Chaos.DrawHierarchy.CellElementThresh"), 128, TEXT("Num elements to consider \"high\" for cell colouring when rendering."))
 
TAutoConsoleVariable< int32CVar_ChaosDrawHierarchyDrawEmptyCells (TEXT("P.Chaos.DrawHierarchy.DrawEmptyCells"), 1, TEXT("Whether to draw cells that are empty when cells are enabled."))
 
TAutoConsoleVariable< int32CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes (TEXT("P.Chaos.UpdateKinematicsOnDeferredSkelMeshes"), 1, TEXT("Whether to defer update kinematics for skeletal meshes."))
 
int32 GEnableKinematicDeferralStartPhysicsCondition = 1
 
FAutoConsoleVariableRef CVar_EnableKinematicDeferralStartPhysicsCondition (TEXT("p.EnableKinematicDeferralStartPhysicsCondition"), GEnableKinematicDeferralStartPhysicsCondition, TEXT("If is 1, allow kinematics to be deferred in start physics (probably only called from replication tick). If 0, no deferral in startphysics."))
 
bool GKinematicDeferralCheckValidBodies = true
 
FAutoConsoleVariableRef CVar_KinematicDeferralCheckValidBodies (TEXT("p.KinematicDeferralCheckValidBodies"), GKinematicDeferralCheckValidBodies, TEXT("If true, don't attempt to update deferred kinematic skeletal mesh bodies which are pending delete."))
 
bool GKinematicDeferralUpdateExternalAccelerationStructure = false
 
FAutoConsoleVariableRef CVar_KinematicDeferralUpdateExternalAccelerationStructure (TEXT("p.KinematicDeferralUpdateExternalAccelerationStructure"), GKinematicDeferralUpdateExternalAccelerationStructure, TEXT("If true, process any operations in PendingSpatialOperations_External before doing deferred kinematic updates."))
 
bool GKinematicDeferralLogInvalidBodies = false
 
FAutoConsoleVariableRef CVar_KinematicDeferralLogInvalidBodies (TEXT("p.KinematicDeferralLogInvalidBodies"), GKinematicDeferralLogInvalidBodies, TEXT("If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update."))
 
bool bGClusterUnionSyncBodiesMoveNewComponents = true
 
FAutoConsoleVariableRef CVar_GClusterUnionSyncBodiesCheckDirtyFlag (TEXT("p.ClusterUnion.SyncBodiesMoveNewComponents"), bGClusterUnionSyncBodiesMoveNewComponents, TEXT("Enable a fix to ensure new components in a cluster union are moved once on add (even if the cluster is not moving)."))
 

Function Documentation

◆ AddPhysicsProxy()

template<typename ObjectType >
void AddPhysicsProxy ( ObjectType *  InObject,
Chaos::FPhysicsSolver InSolver 
)

◆ DECLARE_CYCLE_STAT() [1/4]

DECLARE_CYCLE_STAT ( TEXT("FPhysScene_Chaos::OnSyncBodies-FClusterUnionPhysicsProxy" ,
STAT_SyncBodiesClusterUnionPhysicsProxy  ,
STATGROUP_Chaos   
)

◆ DECLARE_CYCLE_STAT() [2/4]

DECLARE_CYCLE_STAT ( TEXT("FPhysScene_Chaos::OnSyncBodies-FGeometryCollectionPhysicsProxy" ,
STAT_SyncBodiesGeometryCollectionPhysicsProxy  ,
STATGROUP_Chaos   
)

◆ DECLARE_CYCLE_STAT() [3/4]

DECLARE_CYCLE_STAT ( TEXT("FPhysScene_Chaos::OnSyncBodies-FSingleParticlePhysicsProxy" ,
STAT_SyncBodiesSingleParticlePhysicsProxy  ,
STATGROUP_Chaos   
)

◆ DECLARE_CYCLE_STAT() [4/4]

◆ DECLARE_CYCLE_STAT_WITH_FLAGS()

DECLARE_CYCLE_STAT_WITH_FLAGS ( TEXT("FPhysScene_Chaos::OnSyncBodies-FJointConstraintPhysicsProxy" ,
STAT_SyncBodiesJointConstraintPhysicsProxy  ,
STATGROUP_Chaos  ,
EStatFlags::Verbose   
)

◆ DEFINE_LOG_CATEGORY_STATIC()

DEFINE_LOG_CATEGORY_STATIC ( LogFPhysScene_ChaosSolver  ,
Log  ,
All   
)

◆ DumpHierarchyStats()

void DumpHierarchyStats ( const TArray< FString > &  Args)

◆ GatherActorsAndTransforms()

void GatherActorsAndTransforms ( USkeletalMeshComponent *  SkelComp,
const TArray< FTransform > &  InComponentSpaceTransforms,
ETeleportType  Teleport,
bool  bNeedsSkinning,
T_ACTORCONTAINER KinematicUpdateActors,
T_TRANSFORMCONTAINER KinematicUpdateTransforms,
T_ACTORCONTAINER TeleportActors,
T_TRANSFORMCONTAINER TeleportTransforms 
)

◆ ProcessKinematicTargetActors()

void ProcessKinematicTargetActors ( FPhysScene_Chaos Scene,
const TArrayView< FPhysicsActorHandle > &  ActorHandles,
const TArrayView< FTransform > &  Transforms 
)

◆ ProcessTeleportActors()

void ProcessTeleportActors ( FPhysScene_Chaos Scene,
const TArrayView< FPhysicsActorHandle > &  ActorHandles,
const TArrayView< FTransform > &  Transforms 
)

◆ RemovePhysicsProxy()

template<typename ObjectType >
void RemovePhysicsProxy ( ObjectType *  InObject,
Chaos::FPhysicsSolver InSolver,
FChaosSolversModule InModule 
)

Variable Documentation

◆ bGClusterUnionSyncBodiesMoveNewComponents

bool bGClusterUnionSyncBodiesMoveNewComponents = true

◆ CVar_ChaosDrawHierarchyBounds

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyBounds(TEXT("P.Chaos.DrawHierarchy.Bounds"), 1, TEXT("Enable / disable drawing of the physics hierarchy bounds")) ( TEXT("P.Chaos.DrawHierarchy.Bounds")  ,
,
TEXT("Enable / disable drawing of the physics hierarchy bounds"  
)

◆ CVar_ChaosDrawHierarchyCellElementThresh

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyCellElementThresh(TEXT("P.Chaos.DrawHierarchy.CellElementThresh"), 128, TEXT("Num elements to consider \"high\" for cell colouring when rendering.")) ( TEXT("P.Chaos.DrawHierarchy.CellElementThresh")  ,
128  ,
TEXT("Num elements to consider \"high\" for cell colouring when rendering."  
)

◆ CVar_ChaosDrawHierarchyCells

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyCells(TEXT("P.Chaos.DrawHierarchy.Cells"), 0, TEXT("Enable / disable drawing of the physics hierarchy cells")) ( TEXT("P.Chaos.DrawHierarchy.Cells")  ,
,
TEXT("Enable / disable drawing of the physics hierarchy cells"  
)

◆ CVar_ChaosDrawHierarchyDrawEmptyCells

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyDrawEmptyCells(TEXT("P.Chaos.DrawHierarchy.DrawEmptyCells"), 1, TEXT("Whether to draw cells that are empty when cells are enabled.")) ( TEXT("P.Chaos.DrawHierarchy.DrawEmptyCells")  ,
,
TEXT("Whether to draw cells that are empty when cells are enabled."  
)

◆ CVar_ChaosDrawHierarchyEnable

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyEnable(TEXT("P.Chaos.DrawHierarchy.Enable"), 0, TEXT("Enable / disable drawing of the physics hierarchy")) ( TEXT("P.Chaos.DrawHierarchy.Enable")  ,
,
TEXT("Enable / disable drawing of the physics hierarchy"  
)

◆ CVar_ChaosDrawHierarchyObjectBounds

TAutoConsoleVariable< int32 > CVar_ChaosDrawHierarchyObjectBounds(TEXT("P.Chaos.DrawHierarchy.ObjectBounds"), 1, TEXT("Enable / disable drawing of the physics hierarchy object bounds")) ( TEXT("P.Chaos.DrawHierarchy.ObjectBounds")  ,
,
TEXT("Enable / disable drawing of the physics hierarchy object bounds"  
)

◆ CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes

TAutoConsoleVariable< int32 > CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes(TEXT("P.Chaos.UpdateKinematicsOnDeferredSkelMeshes"), 1, TEXT("Whether to defer update kinematics for skeletal meshes.")) ( TEXT("P.Chaos.UpdateKinematicsOnDeferredSkelMeshes")  ,
,
TEXT("Whether to defer update kinematics for skeletal meshes."  
)

◆ CVar_EnableKinematicDeferralStartPhysicsCondition

FAutoConsoleVariableRef CVar_EnableKinematicDeferralStartPhysicsCondition(TEXT("p.EnableKinematicDeferralStartPhysicsCondition"), GEnableKinematicDeferralStartPhysicsCondition, TEXT("If is 1, allow kinematics to be deferred in start physics (probably only called from replication tick). If 0, no deferral in startphysics.")) ( TEXT("p.EnableKinematicDeferralStartPhysicsCondition")  ,
GEnableKinematicDeferralStartPhysicsCondition  ,
TEXT("If is 1, allow kinematics to be deferred in start physics (probably only called from replication tick). If 0, no deferral in startphysics."  
)

◆ CVar_GClusterUnionSyncBodiesCheckDirtyFlag

FAutoConsoleVariableRef CVar_GClusterUnionSyncBodiesCheckDirtyFlag(TEXT("p.ClusterUnion.SyncBodiesMoveNewComponents"), bGClusterUnionSyncBodiesMoveNewComponents, TEXT("Enable a fix to ensure new components in a cluster union are moved once on add (even if the cluster is not moving).")) ( TEXT("p.ClusterUnion.SyncBodiesMoveNewComponents")  ,
bGClusterUnionSyncBodiesMoveNewComponents  ,
TEXT("Enable a fix to ensure new components in a cluster union are moved once on add (even if the cluster is not moving).")   
)

◆ CVar_KinematicDeferralCheckValidBodies

FAutoConsoleVariableRef CVar_KinematicDeferralCheckValidBodies(TEXT("p.KinematicDeferralCheckValidBodies"), GKinematicDeferralCheckValidBodies, TEXT("If true, don't attempt to update deferred kinematic skeletal mesh bodies which are pending delete.")) ( TEXT("p.KinematicDeferralCheckValidBodies")  ,
GKinematicDeferralCheckValidBodies  ,
TEXT("If true, don't attempt to update deferred kinematic skeletal mesh bodies which are pending delete."  
)

◆ CVar_KinematicDeferralLogInvalidBodies

FAutoConsoleVariableRef CVar_KinematicDeferralLogInvalidBodies(TEXT("p.KinematicDeferralLogInvalidBodies"), GKinematicDeferralLogInvalidBodies, TEXT("If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update.")) ( TEXT("p.KinematicDeferralLogInvalidBodies")  ,
GKinematicDeferralLogInvalidBodies  ,
TEXT("If true and p.KinematicDeferralCheckValidBodies is true, log when an invalid body is found on kinematic update."  
)

◆ CVar_KinematicDeferralUpdateExternalAccelerationStructure

FAutoConsoleVariableRef CVar_KinematicDeferralUpdateExternalAccelerationStructure(TEXT("p.KinematicDeferralUpdateExternalAccelerationStructure"), GKinematicDeferralUpdateExternalAccelerationStructure, TEXT("If true, process any operations in PendingSpatialOperations_External before doing deferred kinematic updates.")) ( TEXT("p.KinematicDeferralUpdateExternalAccelerationStructure")  ,
GKinematicDeferralUpdateExternalAccelerationStructure  ,
TEXT("If true, process any operations in PendingSpatialOperations_External before doing deferred kinematic updates."  
)

◆ GEnableKinematicDeferralStartPhysicsCondition

int32 GEnableKinematicDeferralStartPhysicsCondition = 1

◆ GKinematicDeferralCheckValidBodies

bool GKinematicDeferralCheckValidBodies = true

◆ GKinematicDeferralLogInvalidBodies

bool GKinematicDeferralLogInvalidBodies = false

◆ GKinematicDeferralUpdateExternalAccelerationStructure

bool GKinematicDeferralUpdateExternalAccelerationStructure = false