FAnimNode_RigidBody

Controller that simulates physics based on the physics asset of the skeletal mesh component

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AnimGraphRuntime

Header

/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_RigidBody.h

Include

#include "BoneControllers/AnimNode_RigidBody.h"

Syntax

struct FAnimNode_RigidBody : public FAnimNode_SkeletalControlBase

Remarks

Controller that simulates physics based on the physics asset of the skeletal mesh component

Variables

Name Description

Public variable

FBoneReference

 

BaseBoneRef

Matters if SimulationSpace is BaseBone

Public variable

uint8: 1

 

bClampLinearTranslationLimitToRefPose

Correct for linear tearing on bodies with all axes Locked.

Public variable

uint8: 1

 

bEnableWorldGeometry

Public variable

bool

 

bForceDisableCollisionBetweenConstraintBodies

Whether to allow collisions between two bodies joined by a constraint

Public variable

uint8: 1

 

bFreezeIncomingPoseOnStart

When simulation starts, freeze incoming pose.

Public variable

uint8: 1

 

bOverrideWorldGravity

Public variable

uint8: 1

 

bTransferBoneVelocities

When simulation starts, transfer previous bone velocities (from animation) to make transition into simulation seamless.

Public variable

float

 

CachedBoundsScale

Scale of cached bounds (vs. actual bounds).

Public variable

FVector

 

ComponentAppliedLinearAccClamp

When using non-world-space sim, this is an overall clamp on acceleration derived from ComponentLinearAccScale and ComponentLinearVelScale, to ensure it is not too large.

Public variable

FVector

 

ComponentLinearAccScale

When using non-world-space sim, this controls how much of the components world-space acceleration is passed on to the local-space simulation.

Public variable

FVector

 

ComponentLinearVelScale

When using non-world-space sim, this applies a 'drag' to the bodies in the local space simulation, based on the components world-space velocity.

Public variable

float

 

EvaluationResetTime

If the node is not evaluated for this amount of time (seconds), either because a lower LOD was in use for a while or the component was not visible, reset the simulation to the default pose on the next evaluation.

Public variable

FVector

 

ExternalForce

Applies a uniform external force in world space.

Public variable

TEnumAsByte< EC...

 

OverlapChannel

The channel we use to find static geometry to collide with

Public variable

UPhysicsAsset &...

 

OverridePhysicsAsset

Physics asset to use. If empty use the skeletal mesh's default physics asset

Public variable

FVector

 

OverrideWorldGravity

Override gravity

Public variable

FSimSpaceSettin...

 

SimSpaceSettings

Settings for the system which passes motion of the simulation's space into the simulation.

Public variable

ESimulationSpac...

 

SimulationSpace

What space to simulate the bodies in. This affects how velocities are generated

Public variable

float

 

WorldSpaceMinimumScale

For world-space simulations, if the magnitude of the component's 3D scale is less than WorldSpaceMinimumScale, do not update the node.

Constructors

Name Description

Public function

FAnimNode_RigidBody()

Destructors

Name Description

Public function

~FAnimNode_RigidBody()

Functions

Name Description

Public function Virtual

void

 

AddImpulseAtLocation

(
    FVector Impulse,
    FVector Location,
    FName BoneName
)

Public function Virtual

ImmediatePhy...

 

GetSimulation()

TEMP: Exposed for use in PhAt as a quick way to get drag handles working with Chaos.

Public function

void

 

PostSerialize

(
    const FArchive& Ar
)

Overridden from FAnimNode_SkeletalControlBase

Name Description

Public function Virtual

void

 

EvaluateComponentPose_AnyThread

(
    FComponentSpacePoseContext& Output
)

Evaluate incoming component pose.

Public function Virtual

void

 

EvaluateSkeletalControl_AnyThread

(
    FComponentSpacePoseContext& Output,
    TArray< FBoneTransform >& OutBoneT...
)

Evaluate the new component-space transforms for the affected bones.

Public function Virtual

bool

 

IsValidToEvaluate

(
    const USkeleton* Skeleton,
    const FBoneContainer& RequiredBone...
)

Return true if it is valid to Evaluate

Public function Virtual

void

 

UpdateComponentPose_AnyThread

(
    const FAnimationUpdateContext& Con...
)

Update incoming component pose.

Public function Virtual

void

 

UpdateInternal

(
    const FAnimationUpdateContext& Con...
)

Interface for derived skeletal controls to implement use this function to update for skeletal control base

Overridden from FAnimNode_Base

Name Description

Public function Virtual

void

 

GatherDebugData

(
    FNodeDebugData& DebugData
)

Called to gather on-screen debug data. This is called on the game thread.

Public function Virtual Const

int32

 

GetLODThreshold()

Public function Virtual Const

bool

 

HasPreUpdate()

Override this to indicate that PreUpdate() should be called on the game thread (usually to gather non-thread safe data) before Update() is called.

Public function Virtual Const

bool

 

NeedsDynamicReset()

For nodes that implement some kind of simulation, return true here so ResetDynamics() gets called when things like teleports, time skips etc.

Public function Virtual Const

bool

 

NeedsOnInitializeAnimInstance()

For nodes that need some kind of initialization that is not dependent on node relevancy (i.e. it is insufficent or inefficent to use Initialize_AnyThread), return true here.

Public function Virtual

void

 

OnInitializeAnimInstance

(
    const FAnimInstanceProxy* InPr...,
    const UAnimInstance* InAnimIns...
)

Called once, from game thread as the parent anim instance is created

Public function Virtual

void

 

PreUpdate

(
    const UAnimInstance* InAnimIns...
)

Override this to perform game-thread work prior to non-game thread Update() being called

Public function Virtual

void

 

ResetDynamics

(
    ETeleportType InTeleportType
)

Called to help dynamics-based updates to recover correctly from large movements/teleports

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss