FAnimNode_AnimDynamics

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AnimGraphRuntime

Header

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

Include

#include "BoneControllers/AnimNode_AnimDynamics.h"

Syntax

struct FAnimNode_AnimDynamics : public FAnimNode_SkeletalControlBase

Variables

Name Description

Public variable

float

 

AngularBiasOverride

Overridden angular bias value Angular bias is essentially a twist reduction for chain forces and defaults to a value to keep chains stability in check.

Public variable

float

 

AngularDampingOverride

Overridden angular damping value. The default is 0.7. Values below 0.7 won't have an effect.

Public variable

float

 

AngularSpringConstant

Spring constant to use when calculating angular springs, higher values mean a stronger spring.

Public variable

uint8: 1

 

bAngularSpring

If true the body will attempt to align itself with the specified angular target

Public variable

uint8: 1

 

bChain

Set to true to use the solver to simulate a connected chain

Public variable

uint8: 1

 

bDoEval

If true we will perform bone transform evaluation, otherwise skip - allows visualisation of the initial anim state compared to the physics sim

Public variable

uint8: 1

 

bDoUpdate

If true we will perform physics update, otherwise skip - allows visualisation of the initial state of the bodies

Public variable

uint8: 1

 

bEnableWind

Whether or not wind is enabled for the bodies in this simulation

Public variable

uint8: 1

 

bLinearSpring

If true the body will attempt to spring back to its initial position

Public variable

FBoneReference

 

BoundBone

The bone to attach the physics body to, if bChain is true this is the top of the chain

Public variable

uint8: 1

 

bOverrideAngularBias

If true, the override value will be used for the angular bias for bodies in this node.

Public variable

uint8: 1

 

bOverrideAngularDamping

If true, the override value will be used for angular damping

Public variable

uint8: 1

 

bOverrideLinearDamping

If true, the override value will be used for linear damping

Public variable

FVector

 

BoxExtents

Extents of the box to use for simulation

Public variable

uint8: 1

 

bUseGravityOverride

Use gravity override value vs gravity scale

Public variable

uint8: 1

 

bUsePlanarLimit

Whether to evaluate planar limits

Public variable

uint8: 1

 

bUseSphericalLimits

Whether to evaluate spherical limits

Public variable

uint8: 1

 

bWindWasEnabled

Public variable

FBoneReference

 

ChainEnd

If bChain is true this is the bottom of the chain, otherwise ignored

Public variable

AnimPhysCollisi...

 

CollisionType

Resolution method for planar limits

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

FAnimPhysConstr...

 

ConstraintSetup

Data describing the constraints we will apply to the body

Public variable

FVector

 

ExternalForce

An external force to apply to all bodies in the simulation when ticked, specified in world space

Public variable

FVector

 

GravityOverride

Gravity Override Value

Public variable

float

 

GravityScale

Scale for gravity, higher values increase forces due to gravity

Public variable

ETeleportType

 

InitTeleportType

We can't get clean bone positions unless we are in the evaluate step.

Public variable

AnimPhysSimSpac...

 

LastSimSpace

Cached sim space that we last used.

Public variable

float

 

LinearDampingOverride

Overridden linear damping value. The default is 0.7. Values below 0.7 won't have an effect.

Public variable

float

 

LinearSpringConstant

Spring constant to use when calculating linear springs, higher values mean a stronger spring.

Public variable

FVector

 

LocalJointOffset

Vector relative to the body being simulated to attach the constraint to

Public variable

int32

 

NumSolverIterationsPostUpdate

Number of update passes on the linear and angular limits after we solve the position of the bodies, recommended to be around a quarter of NumSolverIterationsPreUpdate

Public variable

int32

 

NumSolverIterationsPreUpdate

Number of update passes on the linear and angular limits before we solve the position of the bodies recommended to be four times the value of NumSolverIterationsPostUpdate

Public variable

TArray< FAnimPh...

 

PlanarLimits

List of available planar limits for this node

Public variable

FTransform

 

PreviousActorWorldSpaceTM

Public variable

FTransform

 

PreviousCompWorldSpaceTM

Previous component & actor transforms, used to account for teleports.

Public variable

FBoneReference

 

RelativeSpaceBone

When in BoneRelative sim space, the simulation will use this bone as the origin

Public variable

FRotationRetarg...

 

RetargetingSettings

The settings for rotation retargeting

Public variable

AnimPhysSimSpac...

 

SimulationSpace

The space used to run the simulation

Public variable

float

 

SphereCollisionRadius

Radius to use if CollisionType is set to CustomSphere

Public variable

TArray< FAnimPh...

 

SphericalLimits

List of available spherical limits for this node

Public variable

float

 

WindScale

Scale to apply to calculated wind velocities in the solver

Constructors

Name Description

Public function

FAnimNode_AnimDynamics()

Functions

Name Description

Public function Const

FVector

 

GetBodyLocalJointOffset

(
    int32 BodyIndex
)

Accessors for editor code (mainly for visualization functions)

Public function Const

const FBoneR...

 

GetBoundBoneReference

(
    int32 Index
)

Gets the specified bound bone reference.

Public function Const

int32

 

GetNumBodies()

Public function Const

int32

 

GetNumBoundBones()

Gets the number of currently bound bones (always 1 unless using a chain)

Public function Const

const FAnimP...

 

GetPhysBody

(
    int32 BodyIndex
)

Public function

void

 

InitPhysics

(
    FComponentSpacePoseContext& Output
)

Public function Static

bool

 

IsAnimDynamicsSystemEnabledFor

(
    int32 InLOD
)

Public function

void

 

RequestInitialise

(
    ETeleportType InTeleportType
)

Public function

void

 

TermPhysics()

Public function

void

 

UpdateLimits

(
    FComponentSpacePoseContext& Output
)

Overridden from FAnimNode_SkeletalControlBase

Name Description

Public function Virtual

void

 

EvaluateSkeletalControl_AnyThread

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

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

Protected function Virtual

void

 

InitializeBoneReferences

(
    const FBoneContainer& RequiredBone...
)

Initialize any bone references you have

Protected function Virtual

bool

 

IsValidToEvaluate

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

Return true if it is valid to Evaluate

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

void

 

Initialize_AnyThread

(
    const FAnimationInitializeContext&...
)

Called when the node first runs.

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

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

Constants

Name

Description

MaxTimeDebt

Maximum time to consider when accumulating time debt to avoid spiraling.

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