p.Chaos.Solver.Collision.MaxPushOutVelocity

p.Chaos.Solver.Collision.MaxPushOutVelocity

#Overview

name: p.Chaos.Solver.Collision.MaxPushOutVelocity

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.Collision.MaxPushOutVelocity is to control the maximum push-out velocity in collision handling within the Chaos physics solver of Unreal Engine 5. This setting is part of the collision system in the Chaos physics engine.

This setting variable is primarily used by the Chaos physics subsystem, specifically within the PBDRigidsSolver (Position Based Dynamics Rigids Solver) module. This is evident from the file location “Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp”.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1.0f, but can be overridden at runtime using the console command system.

This variable interacts closely with ChaosSolverMaxPushOutVelocity, which is the associated C++ variable that directly holds the value set by the console variable. They essentially share the same value.

Developers must be aware that this variable only takes effect when its value is greater than or equal to 0. If the value is negative, it doesn’t override the default behavior. This is evident from the condition check in the PrepareAdvanceBy function: if (ChaosSolverMaxPushOutVelocity >= 0.0f).

Best practices when using this variable include:

  1. Only set it when you need to explicitly control the maximum push-out velocity in collision handling.
  2. Be cautious when setting very high values, as it might lead to unrealistic physics behavior.
  3. Use it in conjunction with other collision-related settings for fine-tuned physics control.

Regarding the associated variable ChaosSolverMaxPushOutVelocity:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:353

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:


		FRealSingle ChaosSolverMaxPushOutVelocity = -1.0f;
		FAutoConsoleVariableRef CVarChaosSolverMaxPushOutVelocity(TEXT("p.Chaos.Solver.Collision.MaxPushOutVelocity"), ChaosSolverMaxPushOutVelocity, TEXT("Override max pushout velocity (if >= 0)"), OnCollisionConfigCVarChanged);

		FRealSingle ChaosSolverDepenetrationVelocity = -1.0f;
		FAutoConsoleVariableRef CVarChaosSolverInitialOverlapDepentrationVelocity(TEXT("p.Chaos.Solver.Collision.DepenetrationVelocity"), ChaosSolverDepenetrationVelocity, TEXT("Override initial overlap depenetration velocity (if >= 0)"), OnCollisionConfigCVarChanged);

		int32 ChaosSolverCleanupCommandsOnDestruction = 1;
		FAutoConsoleVariableRef CVarChaosSolverCleanupCommandsOnDestruction(TEXT("p.Chaos.Solver.CleanupCommandsOnDestruction"), ChaosSolverCleanupCommandsOnDestruction, TEXT("Whether or not to run internal command queue cleanup on solver destruction (0 = no cleanup, >0 = cleanup all commands)"));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:352

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

		FAutoConsoleVariableRef CVarChaosSolverMaxVelocityBoundsExpansionMACD(TEXT("p.Chaos.Solver.Collision.MaxVelocityBoundsExpansionMACD"), ChaosSolverMaxVelocityBoundsExpansionMACD, TEXT("Override max velocity bounds expansion for MACD (if >= 0)"), OnCollisionConfigCVarChanged);

		FRealSingle ChaosSolverMaxPushOutVelocity = -1.0f;
		FAutoConsoleVariableRef CVarChaosSolverMaxPushOutVelocity(TEXT("p.Chaos.Solver.Collision.MaxPushOutVelocity"), ChaosSolverMaxPushOutVelocity, TEXT("Override max pushout velocity (if >= 0)"), OnCollisionConfigCVarChanged);

		FRealSingle ChaosSolverDepenetrationVelocity = -1.0f;
		FAutoConsoleVariableRef CVarChaosSolverInitialOverlapDepentrationVelocity(TEXT("p.Chaos.Solver.Collision.DepenetrationVelocity"), ChaosSolverDepenetrationVelocity, TEXT("Override initial overlap depenetration velocity (if >= 0)"), OnCollisionConfigCVarChanged);

		int32 ChaosSolverCleanupCommandsOnDestruction = 1;
		FAutoConsoleVariableRef CVarChaosSolverCleanupCommandsOnDestruction(TEXT("p.Chaos.Solver.CleanupCommandsOnDestruction"), ChaosSolverCleanupCommandsOnDestruction, TEXT("Whether or not to run internal command queue cleanup on solver destruction (0 = no cleanup, >0 = cleanup all commands)"));

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:1352

Scope (from outer to inner):

file
namespace    Chaos
function     void FPBDRigidsSolver::PrepareAdvanceBy

Source code excerpt:

				SetVelocityBoundsExpansionMACD(ChaosSolverVelocityBoundsMultiplierMACD, ChaosSolverMaxVelocityBoundsExpansionMACD);
			}
			if (ChaosSolverMaxPushOutVelocity >= 0.0f)
			{
				SetCollisionMaxPushOutVelocity(ChaosSolverMaxPushOutVelocity);
			}
			if (ChaosSolverDepenetrationVelocity >= 0.0f)
			{
				SetCollisionDepenetrationVelocity(ChaosSolverDepenetrationVelocity);
			}
			if (ChaosSolverDeterministic >= 0)