p.Chaos.Solver.InertiaConditioning.RotationRatio

p.Chaos.Solver.InertiaConditioning.RotationRatio

#Overview

name: p.Chaos.Solver.InertiaConditioning.RotationRatio

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.Solver.InertiaConditioning.RotationRatio is to control the ratio of joint error correction that comes from particle rotation versus translation in the Chaos physics solver of Unreal Engine 5. This setting is specifically for the inertia conditioning system within the physics simulation.

This setting variable is primarily used in the Chaos physics module, which is part of Unreal Engine’s experimental physics system. Based on the callsites, it’s utilized in the PBDRigidsEvolutionGBF (Position Based Dynamics Rigid Evolution) component of the Chaos solver.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through the console or configuration files. Its default value is set to 2.

The associated variable ChaosSolverInertiaConditioningRotationRatio directly interacts with this console variable. It’s used in the UpdateInertiaConditioning function of the FPBDRigidsEvolutionGBF class to determine the maximum contribution to error correction from rotation.

Developers should be aware that this variable affects the balance between rotational and translational corrections in joint simulations. A higher value will favor rotational corrections over translational ones.

Best practices when using this variable include:

  1. Experiment with different values to find the optimal balance for your specific simulation needs.
  2. Monitor performance and stability when adjusting this value, as it can impact the overall behavior of jointed objects in the physics simulation.
  3. Consider the nature of the objects in your simulation - objects that should rotate more freely might benefit from a higher value, while those that should prioritize translational movement might need a lower value.

Regarding the associated variable ChaosSolverInertiaConditioningRotationRatio:

The purpose of ChaosSolverInertiaConditioningRotationRatio is to store and provide access to the value set by the console variable within the C++ code of the Chaos solver.

This variable is used directly in the Chaos physics solver, specifically in the UpdateInertiaConditioning function of the FPBDRigidsEvolutionGBF class.

Its value is set by the console variable p.Chaos.Solver.InertiaConditioning.RotationRatio.

It interacts directly with the physics simulation code, influencing how joint corrections are calculated and applied.

Developers should be aware that modifying this variable directly in code won’t have an effect unless the console variable is also updated. It’s primarily meant to be a reflection of the console variable’s value within the solver’s code.

Best practices include using this variable for read-only purposes within the solver code, and relying on the console variable for any runtime adjustments to the rotation ratio.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:110

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

		// The ratio of joint error correction that comes from particle rotation versus translation
		FRealSingle ChaosSolverInertiaConditioningRotationRatio = 2;
		FAutoConsoleVariableRef  CVarChaosSolverInertiaConditioningRotationRatio(TEXT("p.Chaos.Solver.InertiaConditioning.RotationRatio"), ChaosSolverInertiaConditioningRotationRatio, TEXT("An input to inertia conditioning system. The maximum ratio of joint correction from rotation versus translation"));

		// If > 1, limits the inverse inertia components to be mo more than this multiple of the smallest component. Makes the objects more round. Set to 0 to disable.
		FRealSingle ChaosSolverMaxInvInertiaComponentRatio = 0;
		FAutoConsoleVariableRef  CVarChaosSolverInertiaConditioningMaxInvInertiaComponentRatio(TEXT("p.Chaos.Solver.InertiaConditioning.MaxInvInertiaComponentRatio"), ChaosSolverMaxInvInertiaComponentRatio, TEXT("An input to inertia conditioning system. The largest inertia component must be at least least multiple of the smallest component"));

		// Collision modifiers are run after the CCD rewind and manifold regeneration because the CCD "contact" data is only used to rewind the particle 

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:109

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:


		// The ratio of joint error correction that comes from particle rotation versus translation
		FRealSingle ChaosSolverInertiaConditioningRotationRatio = 2;
		FAutoConsoleVariableRef  CVarChaosSolverInertiaConditioningRotationRatio(TEXT("p.Chaos.Solver.InertiaConditioning.RotationRatio"), ChaosSolverInertiaConditioningRotationRatio, TEXT("An input to inertia conditioning system. The maximum ratio of joint correction from rotation versus translation"));

		// If > 1, limits the inverse inertia components to be mo more than this multiple of the smallest component. Makes the objects more round. Set to 0 to disable.
		FRealSingle ChaosSolverMaxInvInertiaComponentRatio = 0;
		FAutoConsoleVariableRef  CVarChaosSolverInertiaConditioningMaxInvInertiaComponentRatio(TEXT("p.Chaos.Solver.InertiaConditioning.MaxInvInertiaComponentRatio"), ChaosSolverMaxInvInertiaComponentRatio, TEXT("An input to inertia conditioning system. The largest inertia component must be at least least multiple of the smallest component"));

		// Collision modifiers are run after the CCD rewind and manifold regeneration because the CCD "contact" data is only used to rewind the particle 

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:1641

Scope (from outer to inner):

file
namespace    Chaos
function     void FPBDRigidsEvolutionGBF::UpdateInertiaConditioning

Source code excerpt:

{
	// The maximum contribution to error correction from rotation
	const FRealSingle MaxRotationRatio = ChaosSolverInertiaConditioningRotationRatio;

	// The error distance that the constraint correction must be stable for
	// @todo(chaos): should probably be tied to constraint teleport threshold?
	const FRealSingle MaxDistance = ChaosSolverInertiaConditioningDistance;

	// A limit on the relative sizes of the inertia components (inverse)