p.Chaos.Solver.CharacterGroundConstraint.Priority

p.Chaos.Solver.CharacterGroundConstraint.Priority

#Overview

name: p.Chaos.Solver.CharacterGroundConstraint.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.CharacterGroundConstraint.Priority is to set the priority for character ground constraints in the Chaos physics solver of Unreal Engine 5. This setting is part of the physics simulation system, specifically related to character interactions with the ground.

This setting variable is primarily used in the Chaos physics module, which is part of Unreal Engine’s experimental features. It’s referenced in the PBDRigidsEvolutionGBF.cpp file, which is part of the Chaos solver implementation.

The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 by default, but can be changed at runtime through the console or configuration files.

The associated variable ChaosSolverCharacterGroundConstraintPriority directly interacts with it. 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 constraint will be evaluated later in the solving process.

Best practices when using this variable include:

  1. Only modify it if you understand the implications on the physics simulation.
  2. Test thoroughly after changing the value, as it can affect the behavior of characters interacting with the ground.
  3. Consider the interplay with other constraint priorities in the system.

Regarding the associated variable ChaosSolverCharacterGroundConstraintPriority:

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:


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

		int32 TransferCollisionsLimit = INT_MAX;
		FAutoConsoleVariableRef CVarTransferCollisionsMultiply(TEXT("p.Chaos.Solver.Joint.TransferCollisionsLimit"), TransferCollisionsLimit, TEXT("Maximum number of constraints that are allowed to transfer to the parent. Lowering this will improve performance but reduce accuracy. [def:INT_MAX]"));

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

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

		int32 TransferCollisionsLimit = INT_MAX;
		FAutoConsoleVariableRef CVarTransferCollisionsMultiply(TEXT("p.Chaos.Solver.Joint.TransferCollisionsLimit"), TransferCollisionsLimit, TEXT("Maximum number of constraints that are allowed to transfer to the parent. Lowering this will improve performance but reduce accuracy. [def:INT_MAX]"));

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

Scope (from outer to inner):

file
namespace    Chaos
function     FPBDRigidsEvolutionGBF::FPBDRigidsEvolutionGBF

Source code excerpt:

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

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

FPBDRigidsEvolutionGBF::~FPBDRigidsEvolutionGBF()
{