p.GeometryCollection.TransformTolerance
p.GeometryCollection.TransformTolerance
#Overview
name: p.GeometryCollection.TransformTolerance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Tolerance to detect if a transform has changed
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollection.TransformTolerance is to set a tolerance value for detecting changes in transforms within the Geometry Collection system of Unreal Engine 5. This setting is primarily used in the physics simulation and rendering of Geometry Collections.
-
The Unreal Engine subsystem that relies on this setting variable is the Experimental Chaos physics system, specifically within the Geometry Collection module. This can be seen from the file path “Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp”.
-
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0.001f and can be modified at runtime using the console command “p.GeometryCollection.TransformTolerance”.
-
This variable interacts directly with its associated variable GeometryCollectionTransformTolerance. They share the same value and are used interchangeably in the code.
-
Developers must be aware that this variable affects the precision of transform change detection in Geometry Collections. A smaller value will result in more sensitive detection of changes, while a larger value will be more lenient.
-
Best practices when using this variable include:
- Adjusting it carefully based on the scale and precision requirements of your project.
- Testing thoroughly after changes to ensure it doesn’t negatively impact performance or visual accuracy.
- Considering the trade-off between precision and performance when modifying this value.
Regarding the associated variable GeometryCollectionTransformTolerance:
-
Its purpose is identical to p.GeometryCollection.TransformTolerance, serving as the actual float value used in the code comparisons.
-
It’s used directly in the Chaos physics system, specifically in the FGeometryCollectionPhysicsProxy class.
-
The value is set through the CVar system and shares the same value as p.GeometryCollection.TransformTolerance.
-
It’s used in transform comparison operations, such as in the RebaseParticleGameThreadCollectionTransformOnNewWorldTransform_External function.
-
Developers should be aware that this variable directly affects the behavior of transform comparisons in the Geometry Collection system.
-
Best practices include ensuring consistency between this variable and p.GeometryCollection.TransformTolerance, and understanding the implications of its value on the physics simulation accuracy and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:122
Scope: file
Source code excerpt:
float GeometryCollectionTransformTolerance = 0.001f;
FAutoConsoleVariableRef CVarGeometryCollectionTransformTolerance(
TEXT("p.GeometryCollection.TransformTolerance"),
GeometryCollectionTransformTolerance,
TEXT("Tolerance to detect if a transform has changed"));
float GeometryCollectionPositionUpdateTolerance = UE_KINDA_SMALL_NUMBER;
FAutoConsoleVariableRef CVarGeometryCollectionPositionUpdateTolerance(
TEXT("p.GeometryCollection.PositionUpdateTolerance"),
#Associated Variable and Callsites
This variable is associated with another variable named GeometryCollectionTransformTolerance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:120
Scope: file
Source code excerpt:
TEXT("When true, force diagonal inertia for GCs in their local space by simply dropping off-diagonal terms"));
float GeometryCollectionTransformTolerance = 0.001f;
FAutoConsoleVariableRef CVarGeometryCollectionTransformTolerance(
TEXT("p.GeometryCollection.TransformTolerance"),
GeometryCollectionTransformTolerance,
TEXT("Tolerance to detect if a transform has changed"));
float GeometryCollectionPositionUpdateTolerance = UE_KINDA_SMALL_NUMBER;
FAutoConsoleVariableRef CVarGeometryCollectionPositionUpdateTolerance(
TEXT("p.GeometryCollection.PositionUpdateTolerance"),
GeometryCollectionPositionUpdateTolerance,
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:5946
Scope (from outer to inner):
file
function bool FGeometryCollectionPhysicsProxy::RebaseParticleGameThreadCollectionTransformOnNewWorldTransform_External
Source code excerpt:
NewTransform = ParticleMassToLocal.Inverse() * ComponentScaleTransform * ParticleMassToLocal * NewTransform;
}
if (!NewTransform.Equals(FTransform(GameThreadCollection.GetTransform(TransformIndex)), GeometryCollectionTransformTolerance))
{
bHasDifferentTransforms = true;
GameThreadCollection.SetTransform(TransformIndex, FTransform3f(NewTransform));
}
return bHasDifferentTransforms;
}