p.Chaos.Suspension.DebugDraw.Hardstop

p.Chaos.Suspension.DebugDraw.Hardstop

#Overview

name: p.Chaos.Suspension.DebugDraw.Hardstop

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.DebugDraw.Hardstop is to enable debug drawing of the suspension hardstop manifold in the Chaos physics system of Unreal Engine 5. This setting is specifically related to the vehicle simulation and suspension system within the Chaos physics engine.

This setting variable is primarily used in the Chaos physics subsystem, which is part of the Experimental module in Unreal Engine 5. It’s specifically utilized in the suspension constraints implementation.

The value of this variable is set through the Unreal Engine console variable system. It’s declared as an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files.

The associated variable bChaos_Suspension_DebugDraw_Hardstop directly interacts with this setting. It’s a boolean variable that stores the actual state of the debug drawing feature.

Developers must be aware that:

  1. This variable is only active when CHAOS_DEBUG_DRAW is defined, which is likely a debug build configuration.
  2. Enabling this debug draw might have performance implications, so it should be used carefully in production builds.
  3. The debug drawing is specifically for the hardstop manifold of the suspension system, which might not be relevant for all vehicle simulations.

Best practices when using this variable include:

  1. Use it primarily during development and debugging of vehicle suspension systems.
  2. Disable it in release builds to avoid any potential performance overhead.
  3. Combine it with other Chaos debug drawing tools for a comprehensive view of the physics simulation.

Regarding the associated variable bChaos_Suspension_DebugDraw_Hardstop:

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

Scope: file

Source code excerpt:

#if CHAOS_DEBUG_DRAW
bool bChaos_Suspension_DebugDraw_Hardstop = false;
FAutoConsoleVariableRef CVarChaosSuspensionDebugDrawHardstop(TEXT("p.Chaos.Suspension.DebugDraw.Hardstop"), bChaos_Suspension_DebugDraw_Hardstop, TEXT("Debug draw suspension hardstop manifold"));
#endif

namespace Chaos
{
	FPBDSuspensionConstraintHandle::FPBDSuspensionConstraintHandle(FConstraintContainer* InConstraintContainer, int32 InConstraintIndex) : 
		TIndexedContainerConstraintHandle<FPBDSuspensionConstraints>(InConstraintContainer, InConstraintIndex)

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:


#if CHAOS_DEBUG_DRAW
bool bChaos_Suspension_DebugDraw_Hardstop = false;
FAutoConsoleVariableRef CVarChaosSuspensionDebugDrawHardstop(TEXT("p.Chaos.Suspension.DebugDraw.Hardstop"), bChaos_Suspension_DebugDraw_Hardstop, TEXT("Debug draw suspension hardstop manifold"));
#endif

namespace Chaos
{
	FPBDSuspensionConstraintHandle::FPBDSuspensionConstraintHandle(FConstraintContainer* InConstraintContainer, int32 InConstraintIndex) : 
		TIndexedContainerConstraintHandle<FPBDSuspensionConstraints>(InConstraintContainer, InConstraintIndex)

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

Scope (from outer to inner):

file
namespace    Chaos
function     void FPBDSuspensionConstraints::GatherInput

Source code excerpt:


#if CHAOS_DEBUG_DRAW
				if (bChaos_Suspension_DebugDraw_Hardstop)
				{
					FVec3 Body0Center = WorldArm + BodyP;
					FVec3 Body1Center = PosBody1;
					FReal Radius = 30;
					FDebugDrawQueue::GetInstance().DrawDebugCircle(Body0Center, Radius, 60, FColor::Yellow, false, -1.0f, 0, 3, FVector(1, 0, 0), FVector(0, 1, 0), false);
					FDebugDrawQueue::GetInstance().DrawDebugCircle(Body1Center, Radius, 60, FColor::Green, false, -1.0f, 0, 3, FVector(1, 0, 0), FVector(0, 1, 0), false);