p.Chaos.ImmPhys.FixedStepTime
p.Chaos.ImmPhys.FixedStepTime
#Overview
name: p.Chaos.ImmPhys.FixedStepTime
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Override fixed step time mode: fixed step time (if positive); variable time mode (if zero); asset defined (if negative)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.ImmPhys.FixedStepTime is to control the fixed step time mode in the Chaos Immediate Physics simulation within Unreal Engine 5. This setting variable is part of the physics system, specifically the Chaos physics engine’s immediate mode.
This setting variable is primarily used in the Chaos Immediate Physics simulation, which is part of Unreal Engine’s physics subsystem. Based on the callsites, it’s implemented in the ImmediatePhysicsChaos module.
The value of this variable is set through a console variable (CVarChaosImmPhysFixedStepTime) in the engine’s configuration. It’s associated with the C++ variable ChaosImmediate_Evolution_FixedStepTime.
Other variables that interact with it include ChaosImmediate_Evolution_MinStepTime and ChaosImmediate_Evolution_FixedStepTolerance. These variables work together to control the step time behavior in the physics simulation.
Developers must be aware that this variable has special behavior depending on its value:
- If positive, it sets a fixed step time for the simulation.
- If zero, it puts the simulation into variable time mode.
- If negative, it allows the step time to be defined by the asset.
Best practices when using this variable include:
- Carefully consider the trade-offs between fixed and variable time steps for your specific use case.
- When using fixed step time, ensure it’s appropriate for your game’s frame rate and physics requirements.
- Test thoroughly with different values to find the optimal balance between performance and simulation accuracy.
- Be aware of how this setting interacts with other physics settings, particularly MinStepTime and FixedStepTolerance.
Regarding the associated variable ChaosImmediate_Evolution_FixedStepTime:
The purpose of ChaosImmediate_Evolution_FixedStepTime is to store the actual value used for the fixed step time in the Chaos Immediate Physics simulation.
This variable is used directly in the physics simulation code, specifically in the FSimulation::Simulate function of the ImmediatePhysicsChaos module.
Its value is set by the console variable p.Chaos.ImmPhys.FixedStepTime, allowing for runtime configuration.
It interacts closely with other simulation parameters like collision settings and iteration counts for position, velocity, and projection calculations.
Developers should be aware that this variable directly affects the behavior of the physics simulation and can have significant impacts on both performance and simulation accuracy.
Best practices include:
- Monitoring this value during development to ensure it’s being set as expected from the console variable.
- Considering the implications of changing this value on the overall simulation behavior, especially in conjunction with other physics settings.
- Using appropriate values based on the specific requirements of your game’s physics simulations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:64
Scope: file
Source code excerpt:
Chaos::FRealSingle ChaosImmediate_Evolution_FixedStepTolerance = 0.05f;
FAutoConsoleVariableRef CVarChaosImmPhysMinStepTime(TEXT("p.Chaos.ImmPhys.MinStepTime"), ChaosImmediate_Evolution_MinStepTime, TEXT("If non-zero, then if step time is lower than this, go into fixed step mode with this timestep."));
FAutoConsoleVariableRef CVarChaosImmPhysFixedStepTime(TEXT("p.Chaos.ImmPhys.FixedStepTime"), ChaosImmediate_Evolution_FixedStepTime, TEXT("Override fixed step time mode: fixed step time (if positive); variable time mode (if zero); asset defined (if negative)"));
FAutoConsoleVariableRef CVarChaosImmPhysFixedStepTolerance(TEXT("p.Chaos.ImmPhys.FixedStepTolerance"), ChaosImmediate_Evolution_FixedStepTolerance, TEXT("Time remainder required to add a new step (fraction of FixedStepTime)"));
int32 ChaosImmediate_Collision_Enabled = 1;
int32 ChaosImmediate_Collision_NumPositionFrictionIterations = 0; // No static friction for RBAN
int32 ChaosImmediate_Collision_NumVelocityFrictionIterations = 1; // Dynamic friction for RBAN in velocity solve
int32 ChaosImmediate_Collision_NumPositionShockPropagationIterations = 0;
#Associated Variable and Callsites
This variable is associated with another variable named ChaosImmediate_Evolution_FixedStepTime
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:61
Scope: file
Source code excerpt:
Chaos::FRealSingle ChaosImmediate_Evolution_MinStepTime = 0.01f;
Chaos::FRealSingle ChaosImmediate_Evolution_FixedStepTime = -1.0f;
Chaos::FRealSingle ChaosImmediate_Evolution_FixedStepTolerance = 0.05f;
FAutoConsoleVariableRef CVarChaosImmPhysMinStepTime(TEXT("p.Chaos.ImmPhys.MinStepTime"), ChaosImmediate_Evolution_MinStepTime, TEXT("If non-zero, then if step time is lower than this, go into fixed step mode with this timestep."));
FAutoConsoleVariableRef CVarChaosImmPhysFixedStepTime(TEXT("p.Chaos.ImmPhys.FixedStepTime"), ChaosImmediate_Evolution_FixedStepTime, TEXT("Override fixed step time mode: fixed step time (if positive); variable time mode (if zero); asset defined (if negative)"));
FAutoConsoleVariableRef CVarChaosImmPhysFixedStepTolerance(TEXT("p.Chaos.ImmPhys.FixedStepTolerance"), ChaosImmediate_Evolution_FixedStepTolerance, TEXT("Time remainder required to add a new step (fraction of FixedStepTime)"));
int32 ChaosImmediate_Collision_Enabled = 1;
int32 ChaosImmediate_Collision_NumPositionFrictionIterations = 0; // No static friction for RBAN
int32 ChaosImmediate_Collision_NumVelocityFrictionIterations = 1; // Dynamic friction for RBAN in velocity solve
int32 ChaosImmediate_Collision_NumPositionShockPropagationIterations = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:861
Scope (from outer to inner):
file
namespace ImmediatePhysics_Chaos
function void FSimulation::Simulate
Source code excerpt:
{
SetSolverSettings(
ChaosImmediate_Evolution_FixedStepTime,
ChaosImmediate_Collision_CullDistance,
ChaosImmediate_Collision_MaxDepenetrationVelocity,
ChaosImmediate_Joint_UseLinearSolver,
ChaosImmediate_Evolution_PositionIterations,
ChaosImmediate_Evolution_VelocityIterations,
ChaosImmediate_Evolution_ProjectionIterations);