FAnimNode_SpringBone

Simple controller that replaces or adds to the translation/rotation of a single bone.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

AnimGraphRuntime

Header

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

Include

#include "BoneControllers/AnimNode_SpringBone.h"

Syntax

struct FAnimNode_SpringBone : public FAnimNode_SkeletalControlBase

Remarks

Simple controller that replaces or adds to the translation/rotation of a single bone.

Variables

Name Description

Public variable

uint8: 1

 

bHadValidStrength

Did we have a non-zero ControlStrength last frame.

Public variable

uint8: 1

 

bLimitDisplacement

Limit the amount that a bone can stretch from its ref-pose length.

Public variable

FVector

 

BoneLocation

World-space location of the bone.

Public variable

FVector

 

BoneVelocity

World-space velocity of the bone.

Public variable

uint8: 1

 

bRotateX

If true take the spring calculation for rotation in X

Public variable

uint8: 1

 

bRotateY

If true take the spring calculation for rotation in Y

Public variable

uint8: 1

 

bRotateZ

If true take the spring calculation for rotation in Z

Public variable

uint8: 1

 

bTranslateX

If true take the spring calculation for translation in X

Public variable

uint8: 1

 

bTranslateY

If true take the spring calculation for translation in Y

Public variable

uint8: 1

 

bTranslateZ

If true take the spring calculation for translation in Z

Public variable

float

 

ErrorResetThresh

If spring stretches more than this, reset it. Useful for catching teleports etc

Public variable

float

 

FixedTimeStep

Internal use - Current timestep

Public variable

FVector

 

LocalBoneTransform

Cache of previous frames local bone transform so that when we cannot simulate (timestep == 0) we can still update bone location

Public variable

float

 

MaxDisplacement

If bLimitDisplacement is true, this indicates how long a bone can stretch beyond its length in the ref-pose.

Public variable

FVector

 

OwnerVelocity

Velocity of the owning actor

Public variable

float

 

RemainingTime

Internal use - Amount of time we need to simulate.

Public variable

FBoneReference

 

SpringBone

Name of bone to control. This is the main bone chain to modify from.

Public variable

float

 

SpringDamping

Damping of spring

Public variable

float

 

SpringStiffness

Stiffness of spring

Public variable

float

 

TimeDilation

Internal use - Current time dilation

Constructors

Name Description

Public function

FAnimNode_SpringBone()

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.

Public 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

 

CacheBones_AnyThread

(
    const FAnimationCacheBonesContext&...
)

Called to cache any bones that this node needs to track (e.g. in a FBoneReference).

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

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

void

 

PreUpdate

(
    const UAnimInstance* InAnimIns...
)

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

Deprecated Variables

Name Description

Public variable

bool

 

bNoZSpring_DEPRECATED

If true, Z position is always correct, no spring applied