p.RigidBodyNode.DeferredSimulationForceDefault
p.RigidBodyNode.DeferredSimulationForceDefault
#Overview
name: p.RigidBodyNode.DeferredSimulationForceDefault
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When true, rigid body simulation will always use the value of p.RigidBodyNode.DeferredSimulationDefault to determine whether to defer the simulation work, ignoring the setting in the individual node.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.RigidBodyNode.DeferredSimulationForceDefault is to control whether the rigid body simulation in Unreal Engine 5 should always use a default value for deferred simulation, ignoring individual node settings.
This setting variable is primarily used in the animation system, specifically within the rigid body simulation for skeletal animations. It is part of the AnimGraphRuntime module, which is responsible for handling advanced animation features in Unreal Engine.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files. It is initialized to false by default.
The associated variable bRBAN_DeferredSimulationForceDefault directly interacts with p.RigidBodyNode.DeferredSimulationForceDefault. They share the same value and are used interchangeably in the code.
Developers must be aware that when this variable is set to true, it overrides the individual node settings for deferred simulation. This can have a significant impact on the behavior and performance of rigid body simulations in animations.
Best practices when using this variable include:
- Use it sparingly, as it affects all rigid body simulations globally.
- Consider the performance implications of forcing deferred simulation for all nodes.
- Test thoroughly when enabling this option to ensure it doesn’t negatively impact your specific use case.
Regarding the associated variable bRBAN_DeferredSimulationForceDefault:
The purpose of bRBAN_DeferredSimulationForceDefault is to serve as the internal representation of the p.RigidBodyNode.DeferredSimulationForceDefault setting within the C++ code.
This variable is used directly in the AnimGraphRuntime module, specifically in the FAnimNode_RigidBody class, which handles rigid body simulations for skeletal animations.
The value of this variable is set by the FAutoConsoleVariableRef linked to p.RigidBodyNode.DeferredSimulationForceDefault.
It interacts with other variables in the simulation logic, particularly in determining whether to use deferred simulation tasks.
Developers should be aware that this variable is used in conjunction with SimulationTiming and bRBAN_DeferredSimulationDefault to determine the final simulation behavior.
Best practices for using this variable include:
- Treat it as read-only within the code, as its value is controlled by the console variable.
- Consider its impact on simulation timing when debugging or optimizing rigid body animations.
- Use it in conjunction with other simulation settings to fine-tune the behavior of rigid body nodes in animations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:98
Scope: file
Source code excerpt:
bool bRBAN_DeferredSimulationForceDefault = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDeferredSimulationForceDefault(TEXT("p.RigidBodyNode.DeferredSimulationForceDefault"), bRBAN_DeferredSimulationForceDefault, TEXT("When true, rigid body simulation will always use the value of p.RigidBodyNode.DeferredSimulationDefault to determine whether to defer the simulation work, ignoring the setting in the individual node."), ECVF_Default);
bool bRBAN_DebugDraw = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDebugDraw(TEXT("p.RigidBodyNode.DebugDraw"), bRBAN_DebugDraw, TEXT("Whether to debug draw the rigid body simulation state. Requires p.Chaos.DebugDraw.Enabled 1 to function as well."), ECVF_Default);
// Temporary to avoid out of bounds access issue
bool bRBAN_InitializeBoneReferencesRangeCheckEnabled = true;
#Associated Variable and Callsites
This variable is associated with another variable named bRBAN_DeferredSimulationForceDefault
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:97
Scope: file
Source code excerpt:
ECVF_Default);
bool bRBAN_DeferredSimulationForceDefault = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDeferredSimulationForceDefault(TEXT("p.RigidBodyNode.DeferredSimulationForceDefault"), bRBAN_DeferredSimulationForceDefault, TEXT("When true, rigid body simulation will always use the value of p.RigidBodyNode.DeferredSimulationDefault to determine whether to defer the simulation work, ignoring the setting in the individual node."), ECVF_Default);
bool bRBAN_DebugDraw = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDebugDraw(TEXT("p.RigidBodyNode.DebugDraw"), bRBAN_DebugDraw, TEXT("Whether to debug draw the rigid body simulation state. Requires p.Chaos.DebugDraw.Enabled 1 to function as well."), ECVF_Default);
// Temporary to avoid out of bounds access issue
bool bRBAN_InitializeBoneReferencesRangeCheckEnabled = true;
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:699
Scope (from outer to inner):
file
function void FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread
Source code excerpt:
// Assets can override config for deferred simulation
const bool bUseDeferredSimulationTask =
((SimulationTiming == ESimulationTiming::Default) || bRBAN_DeferredSimulationForceDefault) ? bRBAN_DeferredSimulationDefault : (SimulationTiming == ESimulationTiming::Deferred);
FVector SimSpaceGravity(0.f);
// Only need to tick physics if we didn't reset and we have some time to simulate
const bool bNeedsSimulationTick = ((bSimulateAnimPhysicsAfterReset || (ResetSimulatedTeleportType != ETeleportType::ResetPhysics)) && DeltaSeconds > AnimPhysicsMinDeltaTime);
if (bNeedsSimulationTick)