p.RigidBodyNode.ComponentLinearVelcale
p.RigidBodyNode.ComponentLinearVelcale
#Overview
name: p.RigidBodyNode.ComponentLinearVelcale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
ComponentLinearVelcale override
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.RigidBodyNode.ComponentLinearVelcale is to override the linear velocity scale for rigid body animation nodes (RBAN) in Unreal Engine 5. This setting is part of the animation system, specifically related to physics-based animation.
This setting variable is primarily used in the AnimGraphRuntime module, which is responsible for handling advanced animation graph operations. It’s specifically utilized in the implementation of the FAnimNode_RigidBody class, which handles rigid body physics simulation for skeletal animations.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.
This variable interacts closely with RBAN_Override_ComponentLinearVelScale. They share the same value, and RBAN_Override_ComponentLinearVelScale is used as the actual override value in the code.
Developers should be aware that this variable is part of a set of override variables for rigid body animation nodes. It specifically affects the linear velocity scale of the rigid body simulation. When set to a value greater than or equal to 0, it overrides the ComponentLinearVelScale property of the FAnimNode_RigidBody.
Best practices when using this variable include:
- Use it for fine-tuning physics behavior in animations, especially when dealing with performance or visual issues.
- Be cautious when modifying this value, as it can significantly impact the behavior of rigid body animations.
- Consider using it in conjunction with other related variables like ComponentLinearAccScale and ComponentAppliedLinearAccClamp for comprehensive control over the rigid body simulation.
Regarding the associated variable RBAN_Override_ComponentLinearVelScale:
The purpose of RBAN_Override_ComponentLinearVelScale is to store the actual override value for the component linear velocity scale in rigid body animation nodes.
This variable is used directly in the FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread function to determine the linear velocity scale to be applied in the simulation.
The value of this variable is set through the console variable system, similar to p.RigidBodyNode.ComponentLinearVelcale.
It interacts with the ComponentLinearVelScale property of FAnimNode_RigidBody. When RBAN_Override_ComponentLinearVelScale is greater than or equal to 0, it overrides the ComponentLinearVelScale value.
Developers should be aware that this variable directly affects the behavior of rigid body simulations in animations. A value of -1 indicates that no override should be applied.
Best practices include using this variable for debugging or fine-tuning physics behavior in specific scenarios, and resetting it to -1 when the override is no longer needed to ensure normal behavior of the animation system.
#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:85
Scope: file
Source code excerpt:
float RBAN_Override_ComponentAppliedLinearAccClamp = -1.0f;
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentLinearAccScale(TEXT("p.RigidBodyNode.ComponentLinearAccScale"), RBAN_Override_ComponentLinearAccScale, TEXT("ComponentLinearAccScale override"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentLinearVelScale(TEXT("p.RigidBodyNode.ComponentLinearVelcale"), RBAN_Override_ComponentLinearVelScale, TEXT("ComponentLinearVelcale override"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentAppliedLinearAccClamp(TEXT("p.RigidBodyNode.ComponentAppliedLinearAccClamp"), RBAN_Override_ComponentAppliedLinearAccClamp, TEXT("ComponentAppliedLinearAccClamp override"), ECVF_Default);
float RBAN_GravityScale = 1.0f;
FAutoConsoleVariableRef CVarRigidBodyNodeGravityScale(TEXT("p.RigidBodyNode.GravityScale"), RBAN_GravityScale, TEXT("Multiplies the gravity on all RBANs"), ECVF_Default);
bool bRBAN_DeferredSimulationDefault = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDeferredSimulationDefault(
#Associated Variable and Callsites
This variable is associated with another variable named RBAN_Override_ComponentLinearVelScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:82
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompAngAcc(TEXT("p.RigidBodyNode.Space.MaxAngularAcceleration"), RBAN_SimSpaceOverride_MaxAngularAcceleration, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
float RBAN_Override_ComponentLinearAccScale = -1.0f;
float RBAN_Override_ComponentLinearVelScale = -1.0f;
float RBAN_Override_ComponentAppliedLinearAccClamp = -1.0f;
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentLinearAccScale(TEXT("p.RigidBodyNode.ComponentLinearAccScale"), RBAN_Override_ComponentLinearAccScale, TEXT("ComponentLinearAccScale override"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentLinearVelScale(TEXT("p.RigidBodyNode.ComponentLinearVelcale"), RBAN_Override_ComponentLinearVelScale, TEXT("ComponentLinearVelcale override"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeOverrideComponentAppliedLinearAccClamp(TEXT("p.RigidBodyNode.ComponentAppliedLinearAccClamp"), RBAN_Override_ComponentAppliedLinearAccClamp, TEXT("ComponentAppliedLinearAccClamp override"), ECVF_Default);
float RBAN_GravityScale = 1.0f;
FAutoConsoleVariableRef CVarRigidBodyNodeGravityScale(TEXT("p.RigidBodyNode.GravityScale"), RBAN_GravityScale, TEXT("Multiplies the gravity on all RBANs"), ECVF_Default);
bool bRBAN_DeferredSimulationDefault = false;
FAutoConsoleVariableRef CVarRigidBodyNodeDeferredSimulationDefault(
#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:730
Scope (from outer to inner):
file
function void FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread
Source code excerpt:
else if ((SimulationSpace != ESimulationSpace::WorldSpace) && bRBAN_EnableComponentAcceleration)
{
const FVector UseComponentLinearVelScale = (RBAN_Override_ComponentLinearVelScale >= 0) ? FVector(RBAN_Override_ComponentLinearVelScale) : ComponentLinearVelScale;
const FVector UseComponentLinearAccScale = (RBAN_Override_ComponentLinearAccScale >= 0) ? FVector(RBAN_Override_ComponentLinearAccScale) : ComponentLinearAccScale;
const FVector UseComponentAppliedLinearAccClamp = (RBAN_Override_ComponentAppliedLinearAccClamp >= 0) ? FVector(RBAN_Override_ComponentAppliedLinearAccClamp) : ComponentAppliedLinearAccClamp;
if (!UseComponentLinearVelScale.IsNearlyZero() || !UseComponentLinearAccScale.IsNearlyZero())
{
// Calc linear velocity