p.Chaos.Collision.OneSidedTriangleMesh
p.Chaos.Collision.OneSidedTriangleMesh
#Overview
name: p.Chaos.Collision.OneSidedTriangleMesh
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Collision.OneSidedTriangleMesh is to control whether triangle meshes in the Chaos physics system should be treated as one-sided for collision detection.
This setting variable is primarily used in the Chaos physics system, which is part of Unreal Engine’s experimental physics framework. It is specifically related to the collision detection subsystem within Chaos.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files. It is initialized with a default value of true.
The associated variable bChaos_Collision_OneSidedTriangleMesh directly interacts with this console variable. They share the same value, with the console variable acting as an interface for runtime modification.
Developers must be aware that this variable affects how collision detection is performed for triangle meshes. When set to true, it likely means that collisions will only be detected on one side of the triangle mesh, which can be more performance-efficient but may not be suitable for all use cases.
Best practices when using this variable include:
- Consider the specific requirements of your game’s physics interactions. If you need double-sided collision for triangle meshes, you may need to set this to false.
- Be aware of the performance implications. One-sided collision detection is generally faster, so changing this to false might impact performance.
- Test thoroughly with different values to ensure desired physics behavior in your game.
Regarding the associated variable bChaos_Collision_OneSidedTriangleMesh:
- Its purpose is to store the actual boolean value used in the collision detection code.
- It is used directly in the Chaos collision detection system, likely in functions that handle triangle mesh collisions.
- Its value is set by the console variable p.Chaos.Collision.OneSidedTriangleMesh.
- It interacts closely with other collision-related variables, such as bChaos_Collision_OneSidedHeightField.
- Developers should be aware that modifying the console variable will affect this associated variable, which in turn affects the actual collision detection behavior.
- Best practices include using the console variable for runtime changes and debugging, while relying on this associated variable in the actual collision detection code for performance reasons.
#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:117
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
bool bChaos_Collision_OneSidedTriangleMesh = true;
bool bChaos_Collision_OneSidedHeightField = true;
FAutoConsoleVariableRef CVarChaos_Collision_OneSidedTriangleMesh(TEXT("p.Chaos.Collision.OneSidedTriangleMesh"), bChaos_Collision_OneSidedTriangleMesh, TEXT(""));
FAutoConsoleVariableRef CVarChaos_Collision_OneSidedHeightfield(TEXT("p.Chaos.Collision.OneSidedHeightField"), bChaos_Collision_OneSidedHeightField, TEXT(""));
// Ueed to reject contacts against tri meshes
FRealSingle Chaos_Collision_TriMeshPhiToleranceScale = 1.0f; // A multipler on cull distance. Points farther than this from the deepest point are ignored
FRealSingle Chaos_Collision_TriMeshDistanceTolerance = 0.1f; // Points closer than this to a deeper point are ignored
FAutoConsoleVariableRef CVarChaos_Collision_TriMeshDistanceolerance(TEXT("p.Chaos.Collision.TriangeMeshDistanceTolerance"), Chaos_Collision_TriMeshDistanceTolerance, TEXT(""));
#Associated Variable and Callsites
This variable is associated with another variable named bChaos_Collision_OneSidedTriangleMesh
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifolds.cpp:115
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FAutoConsoleVariableRef CVarChaos_Collision_UseGJK2(TEXT("p.Chaos.Collision.UseGJK2"), bChaos_Collision_UseGJK2, TEXT(""));
bool bChaos_Collision_OneSidedTriangleMesh = true;
bool bChaos_Collision_OneSidedHeightField = true;
FAutoConsoleVariableRef CVarChaos_Collision_OneSidedTriangleMesh(TEXT("p.Chaos.Collision.OneSidedTriangleMesh"), bChaos_Collision_OneSidedTriangleMesh, TEXT(""));
FAutoConsoleVariableRef CVarChaos_Collision_OneSidedHeightfield(TEXT("p.Chaos.Collision.OneSidedHeightField"), bChaos_Collision_OneSidedHeightField, TEXT(""));
// Ueed to reject contacts against tri meshes
FRealSingle Chaos_Collision_TriMeshPhiToleranceScale = 1.0f; // A multipler on cull distance. Points farther than this from the deepest point are ignored
FRealSingle Chaos_Collision_TriMeshDistanceTolerance = 0.1f; // Points closer than this to a deeper point are ignored
FAutoConsoleVariableRef CVarChaos_Collision_TriMeshDistanceolerance(TEXT("p.Chaos.Collision.TriangeMeshDistanceTolerance"), Chaos_Collision_TriMeshDistanceTolerance, TEXT(""));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/CollisionOneShotManifoldsMeshShapes.cpp:29
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
namespace Chaos
{
extern bool bChaos_Collision_OneSidedTriangleMesh;
extern bool bChaos_Collision_OneSidedHeightField;
extern FRealSingle Chaos_Collision_TriMeshDistanceTolerance;
extern FRealSingle Chaos_Collision_TriMeshPhiToleranceScale;
extern int32 Chaos_Collision_MeshManifoldHashSize;
extern bool bChaos_Collision_EnableMeshManifoldOptimizedLoop;
extern bool bChaos_Collision_EnableMeshManifoldOptimizedLoop_TriMesh;