p.EnableOverrideSolverDeltaTime
p.EnableOverrideSolverDeltaTime
#Overview
name: p.EnableOverrideSolverDeltaTime
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, setting for override solver delta time can be used. False will disable this feature.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.EnableOverrideSolverDeltaTime is to control whether the override setting for the solver delta time can be used in the physics engine. This setting is primarily related to the physics simulation system in Unreal Engine 5.
Based on the callsites, this setting variable is used within the Engine module, specifically in the PhysicsEngine subsystem. It’s defined and used in the BodyInstance.cpp file, which is part of the core physics implementation.
The value of this variable is set using an FAutoConsoleVariableRef, which creates a console variable that can be modified at runtime. By default, it is set to true.
The associated variable bEnableOverrideSolverDeltaTime directly interacts with p.EnableOverrideSolverDeltaTime. They share the same value, and bEnableOverrideSolverDeltaTime is used in the actual code logic to determine whether to allow solver delta time overrides.
Developers must be aware that this variable acts as a global switch for the solver delta time override feature. When set to false, it will disable the ability to override the solver delta time, regardless of individual body instance settings.
Best practices when using this variable include:
- Use it to globally enable or disable the solver delta time override feature for debugging or performance testing.
- Be cautious when disabling it, as it may affect physics behavior across the entire game.
- Consider the performance implications of enabling or disabling this feature, especially in physics-heavy scenes.
Regarding the associated variable bEnableOverrideSolverDeltaTime:
The purpose of bEnableOverrideSolverDeltaTime is to serve as the in-code representation of the p.EnableOverrideSolverDeltaTime console variable. It’s used directly in the physics engine code to determine whether to allow solver delta time overrides.
This variable is used in the Engine module, specifically in the PhysicsEngine subsystem, within the FBodyInstance class.
The value of bEnableOverrideSolverDeltaTime is set by the FAutoConsoleVariableRef, which binds it to the p.EnableOverrideSolverDeltaTime console variable.
It interacts directly with the bOverrideSolverAsyncDeltaTime member variable of FBodyInstance. When bEnableOverrideSolverDeltaTime is false, the bOverrideSolverAsyncDeltaTime setting is ignored.
Developers should be aware that this variable is checked in the UpdateSolverAsyncDeltaTime function of FBodyInstance. If it’s false, any attempts to override the solver async delta time will be ignored, and a warning will be logged.
Best practices for using this variable include:
- Use it as a condition check before applying any solver delta time overrides in custom physics code.
- Be aware of its global nature and the potential impact on all physics bodies when changed.
- Consider logging or notifying when this setting prevents intended overrides to aid in debugging.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:87
Scope: file
Source code excerpt:
bool bEnableOverrideSolverDeltaTime = true;
FAutoConsoleVariableRef CVarbEnableOverrideSolverDeltaTime(
TEXT("p.EnableOverrideSolverDeltaTime"),
bEnableOverrideSolverDeltaTime,
TEXT("If true, setting for override solver delta time can be used. False will disable this feature."));
bool bSkipShapeCreationForEmptyBodySetup = false;
FAutoConsoleVariableRef CVarSkipShapeCreationForEmptyBodySetup(
TEXT("p.SkipShapeCreationForEmptyBodySetup"),
#Associated Variable and Callsites
This variable is associated with another variable named bEnableOverrideSolverDeltaTime
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:85
Scope: file
Source code excerpt:
TEXT("If true, an attempt to create a BodyInstance with an invalid transform will fail with a warning"));
bool bEnableOverrideSolverDeltaTime = true;
FAutoConsoleVariableRef CVarbEnableOverrideSolverDeltaTime(
TEXT("p.EnableOverrideSolverDeltaTime"),
bEnableOverrideSolverDeltaTime,
TEXT("If true, setting for override solver delta time can be used. False will disable this feature."));
bool bSkipShapeCreationForEmptyBodySetup = false;
FAutoConsoleVariableRef CVarSkipShapeCreationForEmptyBodySetup(
TEXT("p.SkipShapeCreationForEmptyBodySetup"),
bSkipShapeCreationForEmptyBodySetup,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:4435
Scope (from outer to inner):
file
function void FBodyInstance::UpdateSolverAsyncDeltaTime
Source code excerpt:
void FBodyInstance::UpdateSolverAsyncDeltaTime()
{
if (bOverrideSolverAsyncDeltaTime && !bEnableOverrideSolverDeltaTime)
{
UE_LOG(LogPhysics, Warning, TEXT("FBodyInstance::SolverAsyncDeltaTime : Ignoring parameter because overriden by p.EnableOverrideSolverDeltaTime"));
return;
}
if (bOverrideSolverAsyncDeltaTime)