p.Chaos.Solver.Suspension.Priority

p.Chaos.Solver.Suspension.Priority

#Overview

name: p.Chaos.Solver.Suspension.Priority

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.Suspension.Priority is to set the priority for suspension constraints in the Chaos physics solver of Unreal Engine 5. This setting variable is used in the physics simulation system, specifically for handling vehicle suspension behavior.

The Chaos physics solver, which is part of the Experimental Chaos module in Unreal Engine 5, relies on this setting variable. It is used within the PBDRigidsEvolutionGBF (Position Based Dynamics Rigid Evolution) class, which is a core component of the Chaos physics simulation.

The value of this variable is set through the Unreal Engine console variable system. It is defined as an FAutoConsoleVariableRef, which allows it to be adjusted at runtime through console commands or configuration files.

This variable interacts directly with the associated variable ChaosSolverSuspensionPriority. They share the same value and are used interchangeably in the code.

Developers should be aware that this variable affects the order in which constraints are evaluated in the physics solver. A higher priority value means the suspension constraints will be evaluated later in the solving process.

Best practices when using this variable include:

  1. Carefully consider the relative priorities of different constraint types in your physics simulation.
  2. Test thoroughly when adjusting this value, as it can significantly impact the behavior of vehicle suspensions and potentially other physics interactions.
  3. Use in conjunction with other related priority settings (like joint priorities and collision priorities) to fine-tune the physics simulation behavior.

Regarding the associated variable ChaosSolverSuspensionPriority:

This integer variable is directly used in the AddConstraintContainer function call within the FPBDRigidsEvolutionGBF constructor. It determines the priority of the SuspensionConstraints in the physics solver.

The variable is initialized to 0 by default, but can be modified through the console variable system. Developers should consider adjusting this value if they need to change the order in which suspension constraints are solved relative to other constraint types in the physics simulation.

When working with ChaosSolverSuspensionPriority, it’s important to understand its relationship with other priority settings in the physics solver, such as collision and joint priorities. Balancing these priorities can be crucial for achieving the desired physics behavior in complex simulations, especially those involving vehicles or other systems with suspension mechanics.

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:


		int32 ChaosSolverSuspensionPriority = 0;
		FAutoConsoleVariableRef CVarChaosSolverSuspensionPriority(TEXT("p.Chaos.Solver.Suspension.Priority"), ChaosSolverSuspensionPriority, TEXT("Set constraint priority. Larger values are evaluated later [def:0]"));

		int32 ChaosSolverCharacterGroundConstraintPriority = 0;
		FAutoConsoleVariableRef CVarChaosSolverChaosCharacterGroundConstraintPriority(TEXT("p.Chaos.Solver.CharacterGroundConstraint.Priority"), ChaosSolverCharacterGroundConstraintPriority, TEXT("Set constraint priority. Larger values are evaluated later [def:0]"));

		bool DoTransferJointConstraintCollisions = true;
		FAutoConsoleVariableRef CVarDoTransferJointConstraintCollisions(TEXT("p.Chaos.Solver.Joint.TransferCollisions"), DoTransferJointConstraintCollisions, TEXT("Allows joints to apply collisions to the parent from the child when the Joints TransferCollisionScale is not 0 [def:true]"));

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

		FAutoConsoleVariableRef CVarChaosSolverJointPriority(TEXT("p.Chaos.Solver.Joint.Priority"), ChaosSolverJointPriority, TEXT("Set constraint priority. Larger values are evaluated later [def:0]"));

		int32 ChaosSolverSuspensionPriority = 0;
		FAutoConsoleVariableRef CVarChaosSolverSuspensionPriority(TEXT("p.Chaos.Solver.Suspension.Priority"), ChaosSolverSuspensionPriority, TEXT("Set constraint priority. Larger values are evaluated later [def:0]"));

		int32 ChaosSolverCharacterGroundConstraintPriority = 0;
		FAutoConsoleVariableRef CVarChaosSolverChaosCharacterGroundConstraintPriority(TEXT("p.Chaos.Solver.CharacterGroundConstraint.Priority"), ChaosSolverCharacterGroundConstraintPriority, TEXT("Set constraint priority. Larger values are evaluated later [def:0]"));

		bool DoTransferJointConstraintCollisions = true;
		FAutoConsoleVariableRef CVarDoTransferJointConstraintCollisions(TEXT("p.Chaos.Solver.Joint.TransferCollisions"), DoTransferJointConstraintCollisions, TEXT("Allows joints to apply collisions to the parent from the child when the Joints TransferCollisionScale is not 0 [def:true]"));

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

Scope (from outer to inner):

file
namespace    Chaos
function     FPBDRigidsEvolutionGBF::FPBDRigidsEvolutionGBF

Source code excerpt:

	});

	AddConstraintContainer(SuspensionConstraints, ChaosSolverSuspensionPriority);
	AddConstraintContainer(CollisionConstraints, ChaosSolverCollisionPriority);
	AddConstraintContainer(JointConstraints, ChaosSolverJointPriority);
	AddConstraintContainer(CharacterGroundConstraints, ChaosSolverCharacterGroundConstraintPriority);

	SetInternalParticleInitilizationFunction([](const FGeometryParticleHandle*, const FGeometryParticleHandle*) {});
}