p.Chaos.ImmPhys.SimSpaceEulerAlpha

p.Chaos.ImmPhys.SimSpaceEulerAlpha

#Overview

name: p.Chaos.ImmPhys.SimSpaceEulerAlpha

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.SimSpaceEulerAlpha is to control the Euler force settings in the simulation space system for rigid body nodes in Unreal Engine’s Chaos physics engine, specifically within the Immediate Physics subsystem.

This setting variable is primarily used by the Chaos physics engine, which is part of Unreal Engine’s physics simulation system. It is specifically utilized in the Immediate Physics subsystem, which is designed for high-performance, low-latency physics simulations.

The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 1.0f and can be modified at runtime using console commands or through code.

This variable interacts closely with two other related variables: ChaosImmediate_Evolution_SimSpaceCentrifugalAlpha and ChaosImmediate_Evolution_SimSpaceCoriolisAlpha. Together, these three variables control different aspects of the simulation space system for rigid body nodes.

Developers should be aware that modifying this variable will directly affect the behavior of rigid body simulations in the Immediate Physics system. The Euler force is one of the fundamental forces in physics simulations, and changing its alpha value will alter how objects respond to rotational forces in the simulation.

Best practices when using this variable include:

  1. Testing thoroughly after making changes, as it can significantly impact simulation behavior.
  2. Considering the interplay between this variable and the other simulation space settings (Centrifugal and Coriolis).
  3. Using small incremental changes when adjusting the value, as large changes may lead to unexpected behavior.

Regarding the associated variable ChaosImmediate_Evolution_SimSpaceEulerAlpha:

This is the actual variable that stores the value set by the console variable p.Chaos.ImmPhys.SimSpaceEulerAlpha. It is used directly in the physics simulation code, specifically in the SetSimulationSpaceSettings function of the FSimulation class within the ImmediatePhysics_Chaos namespace.

The purpose of this variable is the same as p.Chaos.ImmPhys.SimSpaceEulerAlpha - to control the Euler force settings in the simulation space system.

It is set through the console variable system and is then used to initialize the EulerAlpha member of the SimSpaceSettings structure in the Immediate Physics simulation.

Developers should treat this variable as read-only in most cases, as it is intended to be modified through the console variable system rather than directly in code. This ensures consistency between the console variable and the actual value used in 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:58

Scope: file

Source code excerpt:

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

#Associated Variable and Callsites

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

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

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

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

Scope (from outer to inner):

file
namespace    ImmediatePhysics_Chaos
function     void FSimulation::SetSimulationSpaceSettings

Source code excerpt:

		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))
		{