p.Chaos.ImmPhys.SimSpaceCoriolisAlpha

p.Chaos.ImmPhys.SimSpaceCoriolisAlpha

#Overview

name: p.Chaos.ImmPhys.SimSpaceCoriolisAlpha

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.Chaos.ImmPhys.SimSpaceCoriolisAlpha is to control the Coriolis effect in the simulation space system for rigid body nodes within Unreal Engine 5’s Chaos physics engine, specifically in the Immediate Physics subsystem.

This setting variable is primarily used in the Chaos physics engine, which is part of Unreal Engine 5’s physics simulation system. It is specifically utilized in the Immediate Physics subsystem, which is likely designed for scenarios requiring real-time or immediate physics calculations.

The value of this variable is set through the Unreal Engine console variable system, as indicated by the FAutoConsoleVariableRef declaration. This allows for runtime modification of the value, which can be useful for debugging or fine-tuning physics behavior.

The variable interacts closely with two other variables: ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha and ChaosImmediate_Evolution_SimSpaceEulerAlpha. These three variables together seem to control different aspects of the simulation space system for rigid body nodes.

Developers should be aware that modifying this variable will affect the Coriolis effect in the physics simulation. The Coriolis effect is an apparent force that affects objects moving in a rotating reference frame, which can be important for certain types of simulations or game mechanics.

Best practices when using this variable include:

  1. Understanding the physical implications of the Coriolis effect in your specific use case.
  2. Testing different values to find the right balance for your simulation needs.
  3. Considering the interplay between this variable and the related centrifugal and Euler variables.
  4. Using the console variable system for quick iteration and testing during development.

Regarding the associated variable ChaosImmediate_Evolution_SimSpaceCoriolisAlpha:

This is the actual variable that stores the value for the Coriolis effect setting. It is initialized with a default value of 0.5f, suggesting that the Coriolis effect is partially applied by default.

The variable is used in the FSimulation::SetSimulationSpaceSettings function to set the CoriolisAlpha property of the SimSpaceSettings object. This indicates that the value is being applied to the simulation space settings of the Immediate Physics system.

Developers should note that while p.Chaos.ImmPhys.SimSpaceCoriolisAlpha is the console variable name used for external access and modification, ChaosImmediate_Evolution_SimSpaceCoriolisAlpha is the actual variable used in the code. Changes to the console variable will directly affect this associated variable.

#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:57

Scope: file

Source code excerpt:

Chaos::FRealSingle ChaosImmediate_Evolution_SimSpaceEulerAlpha = 1.0f;
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceCentrifugalAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceCentrifugalAlpha"), ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha, TEXT("Settings for simulation space system for rigid body nodes"));
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceCoriolisAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceCoriolisAlpha"), ChaosImmediate_Evolution_SimSpaceCoriolisAlpha, TEXT("Settings for simulation space system for rigid body nodes"));
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceEulerAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceEulerAlpha"), ChaosImmediate_Evolution_SimSpaceEulerAlpha, TEXT("Settings for simulation space system for rigid body nodes"));

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."));

#Associated Variable and Callsites

This variable is associated with another variable named ChaosImmediate_Evolution_SimSpaceCoriolisAlpha. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:54

Scope: file

Source code excerpt:


Chaos::FRealSingle ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha = 1.0f;
Chaos::FRealSingle ChaosImmediate_Evolution_SimSpaceCoriolisAlpha = 0.5f;
Chaos::FRealSingle ChaosImmediate_Evolution_SimSpaceEulerAlpha = 1.0f;
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceCentrifugalAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceCentrifugalAlpha"), ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha, TEXT("Settings for simulation space system for rigid body nodes"));
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceCoriolisAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceCoriolisAlpha"), ChaosImmediate_Evolution_SimSpaceCoriolisAlpha, TEXT("Settings for simulation space system for rigid body nodes"));
FAutoConsoleVariableRef CVarChaosImmPhysSimSpaceEulerAlpha(TEXT("p.Chaos.ImmPhys.SimSpaceEulerAlpha"), ChaosImmediate_Evolution_SimSpaceEulerAlpha, TEXT("Settings for simulation space system for rigid body nodes"));

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."));

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:776

Scope (from outer to inner):

file
namespace    ImmediatePhysics_Chaos
function     void FSimulation::SetSimulationSpaceSettings

Source code excerpt:

		SimSpaceSettings.ExternalLinearEtherDrag = ExternalLinearEtherDrag;
		SimSpaceSettings.CentrifugalAlpha = ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha;
		SimSpaceSettings.CoriolisAlpha = ChaosImmediate_Evolution_SimSpaceCoriolisAlpha;
		SimSpaceSettings.EulerAlpha = ChaosImmediate_Evolution_SimSpaceEulerAlpha;
	}

	void FSimulation::SetSolverSettings(const FReal FixedDt, const FReal CullDistance, const FReal MaxDepenetrationVelocity, const int32 UseLinearJointSolver, const int32 PositionIts, const int32 VelocityIts, const int32 ProjectionIts)
	{
		if (FixedDt >= FReal(0))