p.Chaos.Suspension.Spring.Enabled

p.Chaos.Suspension.Spring.Enabled

#Overview

name: p.Chaos.Suspension.Spring.Enabled

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.Suspension.Spring.Enabled is to control the enabling or disabling of the spring component in the suspension constraint within the Chaos physics system of Unreal Engine 5.

This setting variable is primarily used in the Chaos physics subsystem, specifically in the suspension constraint implementation. It’s part of the experimental Chaos module in the Unreal Engine runtime.

The value of this variable is set using an FAutoConsoleVariableRef, which creates a console variable that can be modified at runtime. It’s initialized to true by default, meaning the spring part of the suspension constraint is enabled.

The associated variable bChaos_Suspension_Spring_Enabled directly interacts with p.Chaos.Suspension.Spring.Enabled. They share the same value, with bChaos_Suspension_Spring_Enabled being the actual boolean variable used in the code logic.

Developers must be aware that this variable affects the behavior of vehicle suspensions in the Chaos physics system. When enabled, it allows for the spring component of the suspension to be active, providing a more realistic simulation of vehicle dynamics.

Best practices when using this variable include:

  1. Carefully consider the implications of disabling the spring component, as it may significantly alter vehicle behavior.
  2. Use this variable for debugging or performance optimization purposes, but be cautious about disabling it in production builds unless absolutely necessary.
  3. Test thoroughly when modifying this setting to ensure desired vehicle physics behavior.

Regarding the associated variable bChaos_Suspension_Spring_Enabled:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDSuspensionConstraints.cpp:6

Scope: file

Source code excerpt:


bool bChaos_Suspension_Spring_Enabled = true;
FAutoConsoleVariableRef CVarChaosSuspensionSpringEnabled(TEXT("p.Chaos.Suspension.Spring.Enabled"), bChaos_Suspension_Spring_Enabled, TEXT("Enable/Disable Spring part of suspension constraint"));

bool bChaos_Suspension_Hardstop_Enabled = true;
FAutoConsoleVariableRef CVarChaosSuspensionHardstopEnabled(TEXT("p.Chaos.Suspension.Hardstop.Enabled"), bChaos_Suspension_Hardstop_Enabled, TEXT("Enable/Disable Hardstop part of suspension constraint"));

bool bChaos_Suspension_VelocitySolve = true;
FAutoConsoleVariableRef CVarChaosSuspensionVelocitySolve(TEXT("p.Chaos.Suspension.VelocitySolve"), bChaos_Suspension_VelocitySolve, TEXT("Enable/Disable VelocitySolve"));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDSuspensionConstraints.cpp:5

Scope: file

Source code excerpt:

#include "Chaos/DebugDrawQueue.h"

bool bChaos_Suspension_Spring_Enabled = true;
FAutoConsoleVariableRef CVarChaosSuspensionSpringEnabled(TEXT("p.Chaos.Suspension.Spring.Enabled"), bChaos_Suspension_Spring_Enabled, TEXT("Enable/Disable Spring part of suspension constraint"));

bool bChaos_Suspension_Hardstop_Enabled = true;
FAutoConsoleVariableRef CVarChaosSuspensionHardstopEnabled(TEXT("p.Chaos.Suspension.Hardstop.Enabled"), bChaos_Suspension_Hardstop_Enabled, TEXT("Enable/Disable Hardstop part of suspension constraint"));

bool bChaos_Suspension_VelocitySolve = true;
FAutoConsoleVariableRef CVarChaosSuspensionVelocitySolve(TEXT("p.Chaos.Suspension.VelocitySolve"), bChaos_Suspension_VelocitySolve, TEXT("Enable/Disable VelocitySolve"));

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDSuspensionConstraints.cpp:328

Scope (from outer to inner):

file
namespace    Chaos
function     void FPBDSuspensionConstraints::ApplyPositionConstraint

Source code excerpt:

		}

		if (bChaos_Suspension_Spring_Enabled)
		{
			// Suspension Spring
			ApplySingle(ConstraintIndex, Dt);
		}
	}