UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRootMotionSourceGroup Struct Reference

#include <RootMotionSource.h>

Public Member Functions

ENGINE_API FRootMotionSourceGroup ()
 
virtual ~FRootMotionSourceGroup ()
 
ENGINE_API void CleanUpInvalidRootMotion (float DeltaTime, const ACharacter &Character, UCharacterMovementComponent &MoveComponent)
 
ENGINE_API void PrepareRootMotion (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &InMoveComponent, bool bForcePrepareAll=false)
 
ENGINE_API void AccumulateOverrideRootMotionVelocity (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 
ENGINE_API void AccumulateAdditiveRootMotionVelocity (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 
ENGINE_API bool GetOverrideRootMotionRotation (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FQuat &OutRotation) const
 
ENGINE_API bool NeedsSimulatedSmoothing () const
 
ENGINE_API void SetPendingRootMotionSourceMinStartTimes (float NewStartTime)
 
ENGINE_API void ApplyTimeStampReset (float DeltaTime)
 
ENGINE_API bool HasOverrideVelocity () const
 
ENGINE_API bool HasOverrideVelocityWithIgnoreZAccumulate () const
 
ENGINE_API bool HasAdditiveVelocity () const
 
ENGINE_API bool HasVelocity () const
 
ENGINE_API bool HasActiveRootMotionSources () const
 
ENGINE_API bool HasRootMotionToApply () const
 
ENGINE_API uint16 ApplyRootMotionSource (TSharedPtr< FRootMotionSource > SourcePtr)
 
ENGINE_API TSharedPtr< FRootMotionSourceGetRootMotionSource (FName InstanceName)
 
ENGINE_API TSharedPtr< FRootMotionSourceGetRootMotionSourceByID (uint16 RootMotionSourceID)
 
ENGINE_API void RemoveRootMotionSource (FName InstanceName)
 
ENGINE_API void RemoveRootMotionSourceByID (uint16 RootMotionSourceID)
 
ENGINE_API void UpdateStateFrom (const FRootMotionSourceGroup &GroupToTakeStateFrom, bool bMarkForSimulatedCatchup=false)
 
ENGINE_API bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess, uint8 MaxNumRootMotionSourcesToSerialize=MAX_uint8)
 
ENGINE_API void Clear ()
 
ENGINE_API void CullInvalidSources ()
 
ENGINE_API FRootMotionSourceGroupoperator= (const FRootMotionSourceGroup &Other)
 
ENGINE_API bool operator== (const FRootMotionSourceGroup &Other) const
 
ENGINE_API bool operator!= (const FRootMotionSourceGroup &Other) const
 
ENGINE_API void AddStructReferencedObjects (FReferenceCollector &Collector) const
 

Public Attributes

TArray< TSharedPtr< FRootMotionSource > > RootMotionSources
 
TArray< TSharedPtr< FRootMotionSource > > PendingAddRootMotionSources
 
uint8 bHasAdditiveSources:1
 
uint8 bHasOverrideSources:1
 
uint8 bHasOverrideSourcesWithIgnoreZAccumulate:1
 
uint8 bIsAdditiveVelocityApplied:1
 
FRootMotionSourceSettings LastAccumulatedSettings
 
FVector_NetQuantize10 LastPreAdditiveVelocity
 

Protected Member Functions

ENGINE_API void AccumulateRootMotionVelocity (ERootMotionAccumulateMode RootMotionType, float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 
ENGINE_API void AccumulateRootMotionVelocityFromSource (const FRootMotionSource &RootMotionSource, float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 

Static Protected Member Functions

static ENGINE_API void NetSerializeRMSArray (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess, TArray< TSharedPtr< FRootMotionSource > > &RootMotionSourceArray, uint8 MaxNumRootMotionSourcesToSerialize=MAX_uint8)
 

Detailed Description

Group of Root Motion Sources that are applied

Constructor & Destructor Documentation

◆ FRootMotionSourceGroup()

FRootMotionSourceGroup::FRootMotionSourceGroup ( )

◆ ~FRootMotionSourceGroup()

virtual FRootMotionSourceGroup::~FRootMotionSourceGroup ( )
inlinevirtual

Member Function Documentation

◆ AccumulateAdditiveRootMotionVelocity()

void FRootMotionSourceGroup::AccumulateAdditiveRootMotionVelocity ( float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent MoveComponent,
FVector InOutVelocity 
) const

Helper function for accumulating additive velocity into InOutVelocity

◆ AccumulateOverrideRootMotionVelocity()

void FRootMotionSourceGroup::AccumulateOverrideRootMotionVelocity ( float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent MoveComponent,
FVector InOutVelocity 
) const

Helper function for accumulating override velocity into InOutVelocity

◆ AccumulateRootMotionVelocity()

void FRootMotionSourceGroup::AccumulateRootMotionVelocity ( ERootMotionAccumulateMode  RootMotionType,
float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent MoveComponent,
FVector InOutVelocity 
) const
protected

Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group

◆ AccumulateRootMotionVelocityFromSource()

void FRootMotionSourceGroup::AccumulateRootMotionVelocityFromSource ( const FRootMotionSource RootMotionSource,
float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent MoveComponent,
FVector InOutVelocity 
) const
protected

Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group

◆ AddStructReferencedObjects()

void FRootMotionSourceGroup::AddStructReferencedObjects ( FReferenceCollector Collector) const

Exposes references to GC system

◆ ApplyRootMotionSource()

uint16 FRootMotionSourceGroup::ApplyRootMotionSource ( TSharedPtr< FRootMotionSource SourcePtr)

Apply a RootMotionSource to this Group

Returns
LocalID for this RMS

◆ ApplyTimeStampReset()

void FRootMotionSourceGroup::ApplyTimeStampReset ( float  DeltaTime)

Applies a reset to the start time for each root motion when the time stamp is reset

◆ CleanUpInvalidRootMotion()

void FRootMotionSourceGroup::CleanUpInvalidRootMotion ( float  DeltaTime,
const ACharacter Character,
UCharacterMovementComponent MoveComponent 
)

◆ Clear()

void FRootMotionSourceGroup::Clear ( )

Clear the contents to return it to "empty"

◆ CullInvalidSources()

void FRootMotionSourceGroup::CullInvalidSources ( )

Removes any Sources without a valid ID

◆ GetOverrideRootMotionRotation()

bool FRootMotionSourceGroup::GetOverrideRootMotionRotation ( float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent MoveComponent,
FQuat OutRotation 
) const

Get rotation output of current override root motion source, returns true if OutRotation was filled

◆ GetRootMotionSource()

TSharedPtr< FRootMotionSource > FRootMotionSourceGroup::GetRootMotionSource ( FName  InstanceName)

Get a RootMotionSource from this Group by name

◆ GetRootMotionSourceByID()

TSharedPtr< FRootMotionSource > FRootMotionSourceGroup::GetRootMotionSourceByID ( uint16  RootMotionSourceID)

Get a RootMotionSource from this Group by ID

◆ HasActiveRootMotionSources()

bool FRootMotionSourceGroup::HasActiveRootMotionSources ( ) const
Returns
true if we have Root Motion from any source to use in PerformMovement() physics.

◆ HasAdditiveVelocity()

bool FRootMotionSourceGroup::HasAdditiveVelocity ( ) const
Returns
true if any axis of velocity has additive velocity applied by root motion sources

◆ HasOverrideVelocity()

bool FRootMotionSourceGroup::HasOverrideVelocity ( ) const
Returns
true if Velocity will be overridden by root motion sources, meaning we can skip all normal movement-based velocity calculations

◆ HasOverrideVelocityWithIgnoreZAccumulate()

bool FRootMotionSourceGroup::HasOverrideVelocityWithIgnoreZAccumulate ( ) const
Returns
true if Velocity will be overridden by root motion sources that do not affect Z velocity (matching animation root motion behavior)

◆ HasRootMotionToApply()

bool FRootMotionSourceGroup::HasRootMotionToApply ( ) const
Returns
true if we have Root Motion accumulated from sources to use in PerformMovement() physics. Not valid outside of the scope of that function. Since RootMotion is extracted and used in it.

◆ HasVelocity()

bool FRootMotionSourceGroup::HasVelocity ( ) const
Returns
true if any axis of velocity is modified by root motion sources

◆ NeedsSimulatedSmoothing()

bool FRootMotionSourceGroup::NeedsSimulatedSmoothing ( ) const

Gets whether any active root motion source has been marked to need NetworkSmoothing as a SimulatedProxy

◆ NetSerialize()

bool FRootMotionSourceGroup::NetSerialize ( FArchive Ar,
class UPackageMap Map,
bool bOutSuccess,
uint8  MaxNumRootMotionSourcesToSerialize = MAX_uint8 
)

Serialize the root motion sources and their states for this group

◆ NetSerializeRMSArray()

void FRootMotionSourceGroup::NetSerializeRMSArray ( FArchive Ar,
class UPackageMap Map,
bool bOutSuccess,
TArray< TSharedPtr< FRootMotionSource > > &  RootMotionSourceArray,
uint8  MaxNumRootMotionSourcesToSerialize = MAX_uint8 
)
staticprotected

Helper function for serializing array of root motion sources

◆ operator!=()

bool FRootMotionSourceGroup::operator!= ( const FRootMotionSourceGroup Other) const

Comparison operator

◆ operator=()

FRootMotionSourceGroup & FRootMotionSourceGroup::operator= ( const FRootMotionSourceGroup Other)

Copy operator - deep copy so it can be used for archiving/saving off moves

◆ operator==()

bool FRootMotionSourceGroup::operator== ( const FRootMotionSourceGroup Other) const

Comparison operator - needs matching Sources along with identical states in those sources

◆ PrepareRootMotion()

void FRootMotionSourceGroup::PrepareRootMotion ( float  DeltaTime,
const ACharacter Character,
const UCharacterMovementComponent InMoveComponent,
bool  bForcePrepareAll = false 
)

Generates root motion by accumulating transforms through current root motion sources.

Parameters
bForcePrepareAll- Used during "live" PerformMovements() to ensure all sources get prepared Needed due to SavedMove playback/server correction only applying corrections to Sources that need updating, so in that case we only Prepare those that need it.

◆ RemoveRootMotionSource()

void FRootMotionSourceGroup::RemoveRootMotionSource ( FName  InstanceName)

Remove a RootMotionSource from this Group by name

◆ RemoveRootMotionSourceByID()

void FRootMotionSourceGroup::RemoveRootMotionSourceByID ( uint16  RootMotionSourceID)

Remove a RootMotionSource from this Group by ID

◆ SetPendingRootMotionSourceMinStartTimes()

void FRootMotionSourceGroup::SetPendingRootMotionSourceMinStartTimes ( float  NewStartTime)

Sets the StartTime of all pending root motion sources to be at least this time, can be used on servers to match client-side start times

◆ UpdateStateFrom()

void FRootMotionSourceGroup::UpdateStateFrom ( const FRootMotionSourceGroup GroupToTakeStateFrom,
bool  bMarkForSimulatedCatchup = false 
)

Update contained Sources to state in matching sources from other group. Used for correcting root motion state when receiving authoritative state from server.

Parameters
GroupToTakeStateFromthe Authoritative Group to take state from
bMarkForSimulatedCatchupmarks Sources as needing to return to their current Time on next Prepare
Returns
whether it successfully updated state

Member Data Documentation

◆ bHasAdditiveSources

uint8 FRootMotionSourceGroup::bHasAdditiveSources

Whether this group has additive root motion sources

◆ bHasOverrideSources

uint8 FRootMotionSourceGroup::bHasOverrideSources

Whether this group has override root motion sources

◆ bHasOverrideSourcesWithIgnoreZAccumulate

uint8 FRootMotionSourceGroup::bHasOverrideSourcesWithIgnoreZAccumulate

Whether this group has override root motion sources that have IgnoreZAccumulate flag

◆ bIsAdditiveVelocityApplied

uint8 FRootMotionSourceGroup::bIsAdditiveVelocityApplied

True when we had additive velocity applied last tick, checked to know if we should restore LastPreAdditiveVelocity before a Velocity computation

◆ LastAccumulatedSettings

FRootMotionSourceSettings FRootMotionSourceGroup::LastAccumulatedSettings

Aggregate Settings of the last group of accumulated sources

◆ LastPreAdditiveVelocity

FVector_NetQuantize10 FRootMotionSourceGroup::LastPreAdditiveVelocity

Saved off pre-additive-applied Velocity, used for being able to reliably add/remove additive velocity from currently computed Velocity (otherwise we would be removing additive velocity that no longer exists, like if you run into a wall and your Velocity becomes 0 - subtracting the velocity that we added heading into the wall last tick would make you go backwards. With this method we override that resulting Velocity due to obstructions

◆ PendingAddRootMotionSources

TArray< TSharedPtr<FRootMotionSource> > FRootMotionSourceGroup::PendingAddRootMotionSources

Root Motion Sources to be added next frame

◆ RootMotionSources

TArray< TSharedPtr<FRootMotionSource> > FRootMotionSourceGroup::RootMotionSources

Root Motion Sources currently applied in this Group


The documentation for this struct was generated from the following files: