P.Chaos.UpdateKinematicsOnDeferredSkelMeshes
P.Chaos.UpdateKinematicsOnDeferredSkelMeshes
#Overview
name: P.Chaos.UpdateKinematicsOnDeferredSkelMeshes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to defer update kinematics for skeletal meshes.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of P.Chaos.UpdateKinematicsOnDeferredSkelMeshes is to control whether to defer the update of kinematics for skeletal meshes in the Chaos physics system. This setting variable is primarily used for the physics system, specifically for handling skeletal mesh kinematics updates.
Based on the details in the Callsites section, this variable is used in the Chaos physics subsystem of Unreal Engine. It’s referenced in the PhysScene_Chaos.cpp file, which is part of the Engine’s physics module.
The value of this variable is set as a console variable (CVar) with an initial value of 1. It can be changed at runtime through the console or programmatically.
This variable interacts with another variable named GEnableKinematicDeferralStartPhysicsCondition, which controls whether to allow kinematics to be deferred when starting physics.
Developers must be aware that this variable affects the performance and behavior of skeletal mesh physics simulations. When enabled (set to 1), it defers the kinematic updates for skeletal meshes, which can potentially improve performance in certain scenarios.
Best practices when using this variable include:
- Testing the performance impact with and without deferral enabled for your specific use case.
- Being cautious when changing this value in shipping builds, as it’s wrapped in a #if !UE_BUILD_SHIPPING condition in the code.
- Considering the interaction with GEnableKinematicDeferralStartPhysicsCondition when fine-tuning physics behavior.
Regarding the associated variable CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes:
This is the actual console variable object that corresponds to P.Chaos.UpdateKinematicsOnDeferredSkelMeshes. It’s defined as a TAutoConsoleVariable
The purpose of this variable is the same as P.Chaos.UpdateKinematicsOnDeferredSkelMeshes - to control the deferral of kinematic updates for skeletal meshes in the Chaos physics system.
This variable is used directly in the FPhysScene_Chaos::MarkForPreSimKinematicUpdate function to determine whether to perform deferred updates. The value is retrieved using the GetValueOnGameThread() method.
Developers should be aware that changes to this console variable will take effect immediately at runtime, allowing for dynamic adjustment of the physics behavior.
Best practices for using this variable include:
- Using it for debugging and performance tuning during development.
- Documenting any specific values used in different scenarios for your project.
- Being cautious about exposing this setting to end-users unless necessary, as it can significantly impact physics behavior and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:44
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVar_ChaosDrawHierarchyCellElementThresh(TEXT("P.Chaos.DrawHierarchy.CellElementThresh"), 128, TEXT("Num elements to consider \"high\" for cell colouring when rendering."));
TAutoConsoleVariable<int32> CVar_ChaosDrawHierarchyDrawEmptyCells(TEXT("P.Chaos.DrawHierarchy.DrawEmptyCells"), 1, TEXT("Whether to draw cells that are empty when cells are enabled."));
TAutoConsoleVariable<int32> CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes(TEXT("P.Chaos.UpdateKinematicsOnDeferredSkelMeshes"), 1, TEXT("Whether to defer update kinematics for skeletal meshes."));
#endif
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."));
#Associated Variable and Callsites
This variable is associated with another variable named CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:44
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVar_ChaosDrawHierarchyCellElementThresh(TEXT("P.Chaos.DrawHierarchy.CellElementThresh"), 128, TEXT("Num elements to consider \"high\" for cell colouring when rendering."));
TAutoConsoleVariable<int32> CVar_ChaosDrawHierarchyDrawEmptyCells(TEXT("P.Chaos.DrawHierarchy.DrawEmptyCells"), 1, TEXT("Whether to draw cells that are empty when cells are enabled."));
TAutoConsoleVariable<int32> CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes(TEXT("P.Chaos.UpdateKinematicsOnDeferredSkelMeshes"), 1, TEXT("Whether to defer update kinematics for skeletal meshes."));
#endif
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."));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/Experimental/PhysScene_Chaos.cpp:1594
Scope (from outer to inner):
file
function bool FPhysScene_Chaos::MarkForPreSimKinematicUpdate
Source code excerpt:
{
#if !UE_BUILD_SHIPPING
const bool bDeferredUpdate = CVar_ChaosUpdateKinematicsOnDeferredSkelMeshes.GetValueOnGameThread() != 0;
if (!bDeferredUpdate)
{
return false;
}
#endif