p.Chaos.Collision.UseCapsuleTriMesh2

p.Chaos.Collision.UseCapsuleTriMesh2

#Overview

name: p.Chaos.Collision.UseCapsuleTriMesh2

This variable is created as a Console Variable (cvar).

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:

  1. Testing both true and false values to determine which provides better performance and accuracy for your specific use case.
  2. Considering the impact on gameplay and physics behavior when changing this setting.
  3. Documenting any changes made to this variable in project settings or configuration files.

Regarding the associated variable bChaos_Collision_UseCapsuleTriMesh2:

#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);