p.Chaos.Collision.UseCapsuleTriMesh2
p.Chaos.Collision.UseCapsuleTriMesh2
#Overview
name: p.Chaos.Collision.UseCapsuleTriMesh2
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Collision.UseCapsuleTriMesh2 is to control the collision detection method used for capsule-triangle mesh collisions in Unreal Engine’s Chaos physics system.
This setting variable is primarily used in the Chaos physics subsystem, which is part of Unreal Engine’s experimental physics module. It specifically affects the collision detection algorithms for capsule-triangle mesh interactions.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands or configuration files. It is initialized to true by default.
The associated variable bChaos_Collision_UseCapsuleTriMesh2 directly interacts with p.Chaos.Collision.UseCapsuleTriMesh2. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable determines which algorithm is used for capsule-triangle mesh collision detection. When set to true, it uses a newer algorithm (ConstructCapsuleTriangleOneShotManifold2), and when false, it falls back to an older algorithm (ConstructCapsuleTriangleOneShotManifold).
Best practices when using this variable include:
- Testing both true and false values to determine which provides better performance and accuracy for your specific use case.
- Considering the impact on gameplay and physics behavior when changing this setting.
- Documenting any changes made to this variable in project settings or configuration files.
Regarding the associated variable bChaos_Collision_UseCapsuleTriMesh2:
- Its purpose is to serve as a runtime accessible boolean flag for the p.Chaos.Collision.UseCapsuleTriMesh2 setting.
- It is used directly in the collision detection code to determine which algorithm to use.
- The value is set through the FAutoConsoleVariableRef mechanism, allowing for runtime modifications.
- It interacts directly with the p.Chaos.Collision.UseCapsuleTriMesh2 console variable.
- Developers should be aware that changing this variable at runtime will immediately affect the collision detection behavior for capsule-triangle mesh interactions.
- Best practices include using this variable for debugging and performance testing, and considering its impact on overall physics simulation stability when modifying it.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifolds.cpp:127
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
bool bChaos_Collision_UseCapsuleTriMesh2 = true;
FAutoConsoleVariableRef CVarChaos_Collision_UseCapsuleTriMesh2(TEXT("p.Chaos.Collision.UseCapsuleTriMesh2"), bChaos_Collision_UseCapsuleTriMesh2, TEXT(""));
bool bChaos_Collision_UseConvexTriMesh2 = true;
FAutoConsoleVariableRef CVarChaos_Collision_UseConvexTriMesh2(TEXT("p.Chaos.Collision.UseConvexTriMesh2"), bChaos_Collision_UseConvexTriMesh2, TEXT(""));
namespace Collisions
{
#Associated Variable and Callsites
This variable is associated with another variable named bChaos_Collision_UseCapsuleTriMesh2
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifolds.cpp:126
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FAutoConsoleVariableRef CVarChaos_Collision_TriMeshPhiToleranceScale(TEXT("p.Chaos.Collision.TriangeMeshPhiToleranceScale"), Chaos_Collision_TriMeshPhiToleranceScale, TEXT(""));
bool bChaos_Collision_UseCapsuleTriMesh2 = true;
FAutoConsoleVariableRef CVarChaos_Collision_UseCapsuleTriMesh2(TEXT("p.Chaos.Collision.UseCapsuleTriMesh2"), bChaos_Collision_UseCapsuleTriMesh2, TEXT(""));
bool bChaos_Collision_UseConvexTriMesh2 = true;
FAutoConsoleVariableRef CVarChaos_Collision_UseConvexTriMesh2(TEXT("p.Chaos.Collision.UseConvexTriMesh2"), bChaos_Collision_UseConvexTriMesh2, TEXT(""));
namespace Collisions
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifoldsMeshShapes.cpp:38
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
extern bool bChaos_Collision_EnableMACDFallback;
extern bool bChaos_Collision_UseCapsuleTriMesh2;
extern bool bChaos_Collision_UseConvexTriMesh2;
namespace CVars
{
#if CHAOS_DEBUG_DRAW
extern DebugDraw::FChaosDebugDrawSettings ChaosSolverDebugDebugDrawSettings;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifoldsMeshShapes.cpp:109
Scope (from outer to inner):
file
namespace Chaos
namespace Collisions
function void GenerateConvexTriangleOneShotManifold<FImplicitCapsule3>
Source code excerpt:
void GenerateConvexTriangleOneShotManifold<FImplicitCapsule3>(const FImplicitCapsule3& Capsule, const FTriangle& Triangle, const FReal CullDistance, FContactPointManifold& OutContactPoints)
{
if (bChaos_Collision_UseCapsuleTriMesh2)
{
ConstructCapsuleTriangleOneShotManifold2(Capsule, Triangle, CullDistance, OutContactPoints);
}
else
{
ConstructCapsuleTriangleOneShotManifold(Capsule, Triangle, CullDistance, OutContactPoints);