p.GeometryCollection.RotationUpdateTolerance
p.GeometryCollection.RotationUpdateTolerance
#Overview
name: p.GeometryCollection.RotationUpdateTolerance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Tolerance to detect if particle rotation has changed has changed when syncing PT to GT
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollection.RotationUpdateTolerance is to set a tolerance threshold for detecting changes in particle rotation when synchronizing the Physics Thread (PT) to the Game Thread (GT) in Unreal Engine’s Geometry Collection system.
This setting variable is primarily used in the Geometry Collection system, which is part of Unreal Engine’s Chaos physics engine. It’s specifically utilized in the GeometryCollectionPhysicsProxy module.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through the console. It’s initialized with the value of UE_KINDA_SMALL_NUMBER, which is a very small floating-point number used in Unreal Engine for comparison tolerances.
The associated variable GeometryCollectionRotationUpdateTolerance directly interacts with p.GeometryCollection.RotationUpdateTolerance. They share the same value and purpose.
Developers must be aware that this variable affects the sensitivity of rotation change detection in Geometry Collections. A smaller value will lead to more frequent updates, potentially increasing accuracy but also computational cost. Conversely, a larger value may improve performance but could miss subtle rotation changes.
Best practices when using this variable include:
- Carefully adjusting the value based on the specific needs of your project.
- Monitoring performance impact when modifying this value.
- Testing thoroughly to ensure that the chosen value doesn’t lead to visual artifacts or physics simulation issues.
- Considering the scale and typical movement patterns of your Geometry Collection objects when setting this value.
Regarding the associated variable GeometryCollectionRotationUpdateTolerance:
This variable is used directly in the code to perform the actual comparison for rotation updates. It’s used in the UpdateGTParticleXR function to determine if a particle’s rotation needs to be updated on the Game Thread.
The purpose and considerations for GeometryCollectionRotationUpdateTolerance are identical to p.GeometryCollection.RotationUpdateTolerance, as they share the same value. Developers should treat them as one and the same when considering their impact on the system.
#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:134
Scope: file
Source code excerpt:
float GeometryCollectionRotationUpdateTolerance = UE_KINDA_SMALL_NUMBER;
FAutoConsoleVariableRef CVarGeometryCollectionRotationUpdateTolerance(
TEXT("p.GeometryCollection.RotationUpdateTolerance"),
GeometryCollectionRotationUpdateTolerance,
TEXT("Tolerance to detect if particle rotation has changed has changed when syncing PT to GT"));
bool bGeometryCollectionUseRootBrokenFlag = true;
FAutoConsoleVariableRef CVarGeometryCollectionUseRootBrokenFlag(
TEXT("p.GeometryCollection.UseRootBrokenFlag"),
#Associated Variable and Callsites
This variable is associated with another variable named GeometryCollectionRotationUpdateTolerance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:132
Scope: file
Source code excerpt:
TEXT("Tolerance to detect if particle position has changed has changed when syncing PT to GT"));
float GeometryCollectionRotationUpdateTolerance = UE_KINDA_SMALL_NUMBER;
FAutoConsoleVariableRef CVarGeometryCollectionRotationUpdateTolerance(
TEXT("p.GeometryCollection.RotationUpdateTolerance"),
GeometryCollectionRotationUpdateTolerance,
TEXT("Tolerance to detect if particle rotation has changed has changed when syncing PT to GT"));
bool bGeometryCollectionUseRootBrokenFlag = true;
FAutoConsoleVariableRef CVarGeometryCollectionUseRootBrokenFlag(
TEXT("p.GeometryCollection.UseRootBrokenFlag"),
bGeometryCollectionUseRootBrokenFlag,
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:3984
Scope (from outer to inner):
file
function static inline bool UpdateGTParticleXR
Source code excerpt:
const Chaos::FRotation3 OldR = GTParticle.R();
const bool bNeedUpdateR = (!NewR.Equals(OldR, GeometryCollectionRotationUpdateTolerance));
if (bNeedUpdateR)
{
GTParticle.SetR(NewR, false);
}
const bool bChanged = (bNeedUpdateX || bNeedUpdateR);