p.RigidBodyNode.Space.MaxAngularAcceleration

p.RigidBodyNode.Space.MaxAngularAcceleration

#Overview

name: p.RigidBodyNode.Space.MaxAngularAcceleration

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.RigidBodyNode.Space.MaxAngularAcceleration is to override the maximum angular acceleration for the Rigid Body Animation Node (RBAN) in Unreal Engine’s animation system. This setting is part of the simulation space settings for rigid body physics in animations.

This setting variable is primarily used in the AnimGraphRuntime module, specifically within the Rigid Body Animation Node system. It’s part of the bone controllers that handle physics-based animations.

The value of this variable is set through a console variable (CVar) system, which allows for runtime modification. It’s initialized in the AnimNode_RigidBody.cpp file.

This variable interacts closely with other simulation space settings, such as MaxAngularVelocity and MaxLinearAcceleration. It’s associated with the RBAN_SimSpaceOverride_MaxAngularAcceleration variable, which shares the same value.

Developers must be aware that this variable is part of a set of override settings. When its value is set to -1.0f (the default), it doesn’t override the existing settings. Only when set to a value >= 0.0f does it override the MaxAngularAcceleration in the simulation space settings.

Best practices when using this variable include:

  1. Only modify it when you need to fine-tune the physics behavior of rigid body animations.
  2. Be cautious when setting extreme values, as it might lead to unrealistic or unstable animations.
  3. Consider the interplay between this and other related settings (like MaxAngularVelocity) for balanced physics behavior.

Regarding the associated variable RBAN_SimSpaceOverride_MaxAngularAcceleration:

The purpose of RBAN_SimSpaceOverride_MaxAngularAcceleration is to store the override value for the maximum angular acceleration in the rigid body animation system.

This variable is used in the AnimGraphRuntime module, specifically within the FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread function.

Its value is set through the console variable system, initialized in the same file as p.RigidBodyNode.Space.MaxAngularAcceleration.

It directly interacts with the UseSimSpaceSettings.MaxAngularAcceleration property when its value is >= 0.0f.

Developers should be aware that this variable is part of a group of simulation space override settings and only takes effect when set to a non-negative value.

Best practices for using this variable include:

  1. Use it in conjunction with other simulation space override settings for consistent behavior.
  2. Monitor its impact on animation performance and stability when modified.
  3. Reset it to -1.0f when you want to revert to the default behavior.

#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:80

Scope: file

Source code excerpt:

FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompAngVel(TEXT("p.RigidBodyNode.Space.MaxAngularVelocity"), RBAN_SimSpaceOverride_MaxAngularVelocity, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompLinAcc(TEXT("p.RigidBodyNode.Space.MaxLinearAcceleration"), RBAN_SimSpaceOverride_MaxLinearAcceleration, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
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);

#Associated Variable and Callsites

This variable is associated with another variable named RBAN_SimSpaceOverride_MaxAngularAcceleration. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:73

Scope: file

Source code excerpt:

float RBAN_SimSpaceOverride_MaxAngularVelocity = -1.0f;
float RBAN_SimSpaceOverride_MaxLinearAcceleration = -1.0f;
float RBAN_SimSpaceOverride_MaxAngularAcceleration = -1.0f;
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceOverride(TEXT("p.RigidBodyNode.Space.Override"), bRBAN_SimSpace_EnableOverride, TEXT("Force-enable the advanced simulation space movement forces"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceWorldAlpha(TEXT("p.RigidBodyNode.Space.WorldAlpha"), RBAN_SimSpaceOverride_WorldAlpha, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceVelScaleZ(TEXT("p.RigidBodyNode.Space.VelocityScaleZ"), RBAN_SimSpaceOverride_VelocityScaleZ, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompLinVel(TEXT("p.RigidBodyNode.Space.MaxLinearVelocity"), RBAN_SimSpaceOverride_MaxLinearVelocity, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompAngVel(TEXT("p.RigidBodyNode.Space.MaxAngularVelocity"), RBAN_SimSpaceOverride_MaxAngularVelocity, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
FAutoConsoleVariableRef CVarRigidBodyNodeSpaceMaxCompLinAcc(TEXT("p.RigidBodyNode.Space.MaxLinearAcceleration"), RBAN_SimSpaceOverride_MaxLinearAcceleration, TEXT("RBAN SimSpaceSettings overrides"), ECVF_Default);
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);

#Loc: <Workspace>/Engine/Source/Runtime/AnimGraphRuntime/Private/BoneControllers/AnimNode_RigidBody.cpp:804

Scope (from outer to inner):

file
function     void FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread

Source code excerpt:

				if (RBAN_SimSpaceOverride_MaxAngularVelocity >= 0.0f) UseSimSpaceSettings.MaxAngularVelocity = RBAN_SimSpaceOverride_MaxAngularVelocity;
				if (RBAN_SimSpaceOverride_MaxLinearAcceleration >= 0.0f) UseSimSpaceSettings.MaxLinearAcceleration = RBAN_SimSpaceOverride_MaxLinearAcceleration;
				if (RBAN_SimSpaceOverride_MaxAngularAcceleration >= 0.0f) UseSimSpaceSettings.MaxAngularAcceleration = RBAN_SimSpaceOverride_MaxAngularAcceleration;
			}

			FTransform SimulationTransform;
			FVector SimulationLinearVelocity;
			FVector SimulationAngularVelocity;
			FVector SimulationLinearAcceleration;