p.RigidBodyNode
p.RigidBodyNode
#Overview
name: p.RigidBodyNode
The value of this variable can be defined or overridden in .ini config files. 3
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables/disables the whole rigid body node system. When disabled, avoids all allocations and runtime costs. Can be used to disable RB Nodes on low-end platforms.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.RigidBodyNode is to enable or disable the entire rigid body node system in Unreal Engine’s animation system. This setting variable is primarily used for performance optimization and scalability across different platforms.
The Unreal Engine subsystem that relies on this setting variable is the animation system, specifically the AnimGraphRuntime module. This can be seen from the file path where the variable is defined and used: Engine/Source/Runtime/AnimGraphRuntime/
.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of true and can be changed at runtime using console commands or through configuration files.
The p.RigidBodyNode variable interacts directly with the bEnableRigidBodyNode variable. They share the same value, and bEnableRigidBodyNode is used in the actual code logic to determine whether the rigid body node system should be enabled.
Developers must be aware that disabling this variable will avoid all allocations and runtime costs associated with the rigid body node system. This can be particularly useful for optimizing performance on low-end platforms.
Best practices when using this variable include:
- Leaving it enabled by default for most platforms.
- Consider disabling it for low-end platforms or in situations where physics-based animation is not needed.
- Use it in conjunction with other related variables like p.RigidBodyNode.EnableSimulation and p.RigidBodyLODThreshold for fine-tuned control over the rigid body simulation.
Regarding the associated variable bEnableRigidBodyNode:
The purpose of bEnableRigidBodyNode is to serve as the actual boolean flag used in the code to determine if the rigid body node system should be active.
It’s used directly in the AnimGraphRuntime module, specifically in the FAnimNode_RigidBody::InitPhysics function to determine if the physics simulation should be set up.
The value of this variable is set by the p.RigidBodyNode console variable.
This variable interacts with other conditions like UsePhysicsAsset and SkeletalMeshComp->GetAllowRigidBodyAnimNode() to determine the final enabled state of the rigid body node.
Developers should be aware that this variable is exposed as an external variable in the AnimNode_RigidBody.h header file, allowing it to be accessed from other parts of the engine or game code.
Best practices include using this variable for runtime checks of whether the rigid body node system is enabled, rather than directly accessing the console variable.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:139, section: [IOS_High DeviceProfile]
- INI Section:
IOS_High DeviceProfile
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:154, section: [IOS_Epic DeviceProfile]
- INI Section:
IOS_Epic DeviceProfile
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultDeviceProfiles.ini:566, section: [Android_Epic DeviceProfile]
- INI Section:
Android_Epic DeviceProfile
- Raw value:
1
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:50
Scope: file
Source code excerpt:
bool bEnableRigidBodyNode = true;
FAutoConsoleVariableRef CVarEnableRigidBodyNode(TEXT("p.RigidBodyNode"), bEnableRigidBodyNode, TEXT("Enables/disables the whole rigid body node system. When disabled, avoids all allocations and runtime costs. Can be used to disable RB Nodes on low-end platforms."), ECVF_Scalability);
TAutoConsoleVariable<int32> CVarEnableRigidBodyNodeSimulation(TEXT("p.RigidBodyNode.EnableSimulation"), 1, TEXT("Runtime Enable/Disable RB Node Simulation for debugging and testing (node is initialized and bodies and constraints are created, even when disabled.)"), ECVF_Default);
TAutoConsoleVariable<int32> CVarRigidBodyLODThreshold(TEXT("p.RigidBodyLODThreshold"), -1, TEXT("Max LOD that rigid body node is allowed to run on. Provides a global threshold that overrides per-node the LODThreshold property. -1 means no override."), ECVF_Scalability);
int32 RBAN_MaxSubSteps = 4;
bool bRBAN_EnableTimeBasedReset = true;
bool bRBAN_EnableComponentAcceleration = true;
#Associated Variable and Callsites
This variable is associated with another variable named bEnableRigidBodyNode
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:49
Scope: file
Source code excerpt:
DEFINE_LOG_CATEGORY(LogRBAN);
bool bEnableRigidBodyNode = true;
FAutoConsoleVariableRef CVarEnableRigidBodyNode(TEXT("p.RigidBodyNode"), bEnableRigidBodyNode, TEXT("Enables/disables the whole rigid body node system. When disabled, avoids all allocations and runtime costs. Can be used to disable RB Nodes on low-end platforms."), ECVF_Scalability);
TAutoConsoleVariable<int32> CVarEnableRigidBodyNodeSimulation(TEXT("p.RigidBodyNode.EnableSimulation"), 1, TEXT("Runtime Enable/Disable RB Node Simulation for debugging and testing (node is initialized and bodies and constraints are created, even when disabled.)"), ECVF_Default);
TAutoConsoleVariable<int32> CVarRigidBodyLODThreshold(TEXT("p.RigidBodyLODThreshold"), -1, TEXT("Max LOD that rigid body node is allowed to run on. Provides a global threshold that overrides per-node the LODThreshold property. -1 means no override."), ECVF_Scalability);
int32 RBAN_MaxSubSteps = 4;
bool bRBAN_EnableTimeBasedReset = true;
bool bRBAN_EnableComponentAcceleration = true;
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:1059
Scope (from outer to inner):
file
function void FAnimNode_RigidBody::InitPhysics
Source code excerpt:
}
bEnabled = (UsePhysicsAsset && bEnableRigidBodyNode && SkeletalMeshComp->GetAllowRigidBodyAnimNode());
if(bEnabled)
{
SCOPE_CYCLE_COUNTER(STAT_RigidBodyNodeInitTime_SetupSimulation);
PhysicsSimulation = new ImmediatePhysics::FSimulation();
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_RigidBody.h:14
Scope: file
Source code excerpt:
class FEvent;
extern ANIMGRAPHRUNTIME_API bool bEnableRigidBodyNode;
extern ANIMGRAPHRUNTIME_API FAutoConsoleVariableRef CVarEnableRigidBodyNode;
extern ANIMGRAPHRUNTIME_API TAutoConsoleVariable<int32> CVarEnableRigidBodyNodeSimulation;
extern ANIMGRAPHRUNTIME_API TAutoConsoleVariable<int32> CVarRigidBodyLODThreshold;
/** Determines in what space the simulation should run */
UENUM()