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).
- type:
Var
- help:
Debug draw suspension hardstop manifold
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:
- This variable is only active when
CHAOS_DEBUG_DRAW
is defined, which is likely a debug build configuration. - Enabling this debug draw might have performance implications, so it should be used carefully in production builds.
- 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:
- Use it primarily during development and debugging of vehicle suspension systems.
- Disable it in release builds to avoid any potential performance overhead.
- Combine it with other Chaos debug drawing tools for a comprehensive view of the physics simulation.
Regarding the associated variable bChaos_Suspension_DebugDraw_Hardstop
:
- Its purpose is to store the actual state of the debug drawing feature for the suspension hardstop.
- It’s used directly in the Chaos physics code to conditionally execute debug drawing commands.
- The value is set by the console variable system through
p.Chaos.Suspension.DebugDraw.Hardstop
. - It’s used in the
FPBDSuspensionConstraints::GatherInput
function to determine whether to perform debug drawing. - Developers should be aware that this variable is only checked when
CHAOS_DEBUG_DRAW
is defined. - Best practice is to use this variable for temporary debugging and ensure it’s not affecting performance in production builds.
#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);