![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <RootMotionSource.h>
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) |
Group of Root Motion Sources that are applied
| FRootMotionSourceGroup::FRootMotionSourceGroup | ( | ) |
|
inlinevirtual |
| void FRootMotionSourceGroup::AccumulateAdditiveRootMotionVelocity | ( | float | DeltaTime, |
| const ACharacter & | Character, | ||
| const UCharacterMovementComponent & | MoveComponent, | ||
| FVector & | InOutVelocity | ||
| ) | const |
Helper function for accumulating additive velocity into InOutVelocity
| void FRootMotionSourceGroup::AccumulateOverrideRootMotionVelocity | ( | float | DeltaTime, |
| const ACharacter & | Character, | ||
| const UCharacterMovementComponent & | MoveComponent, | ||
| FVector & | InOutVelocity | ||
| ) | const |
Helper function for accumulating override velocity into InOutVelocity
|
protected |
Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group
|
protected |
Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group
| void FRootMotionSourceGroup::AddStructReferencedObjects | ( | FReferenceCollector & | Collector | ) | const |
Exposes references to GC system
| uint16 FRootMotionSourceGroup::ApplyRootMotionSource | ( | TSharedPtr< FRootMotionSource > | SourcePtr | ) |
Apply a RootMotionSource to this Group
Applies a reset to the start time for each root motion when the time stamp is reset
| void FRootMotionSourceGroup::CleanUpInvalidRootMotion | ( | float | DeltaTime, |
| const ACharacter & | Character, | ||
| UCharacterMovementComponent & | MoveComponent | ||
| ) |
| void FRootMotionSourceGroup::Clear | ( | ) |
Clear the contents to return it to "empty"
| void FRootMotionSourceGroup::CullInvalidSources | ( | ) |
Removes any Sources without a valid ID
| 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
| TSharedPtr< FRootMotionSource > FRootMotionSourceGroup::GetRootMotionSource | ( | FName | InstanceName | ) |
Get a RootMotionSource from this Group by name
| TSharedPtr< FRootMotionSource > FRootMotionSourceGroup::GetRootMotionSourceByID | ( | uint16 | RootMotionSourceID | ) |
Get a RootMotionSource from this Group by ID
| bool FRootMotionSourceGroup::HasActiveRootMotionSources | ( | ) | const |
| bool FRootMotionSourceGroup::HasAdditiveVelocity | ( | ) | const |
| bool FRootMotionSourceGroup::HasOverrideVelocity | ( | ) | const |
| bool FRootMotionSourceGroup::HasOverrideVelocityWithIgnoreZAccumulate | ( | ) | const |
| bool FRootMotionSourceGroup::HasRootMotionToApply | ( | ) | const |
| bool FRootMotionSourceGroup::HasVelocity | ( | ) | const |
| bool FRootMotionSourceGroup::NeedsSimulatedSmoothing | ( | ) | const |
Gets whether any active root motion source has been marked to need NetworkSmoothing as a SimulatedProxy
| 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
|
staticprotected |
Helper function for serializing array of root motion sources
| bool FRootMotionSourceGroup::operator!= | ( | const FRootMotionSourceGroup & | Other | ) | const |
Comparison operator
| FRootMotionSourceGroup & FRootMotionSourceGroup::operator= | ( | const FRootMotionSourceGroup & | Other | ) |
Copy operator - deep copy so it can be used for archiving/saving off moves
| bool FRootMotionSourceGroup::operator== | ( | const FRootMotionSourceGroup & | Other | ) | const |
Comparison operator - needs matching Sources along with identical states in those sources
| 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.
| 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. |
Remove a RootMotionSource from this Group by name
Remove a RootMotionSource from this Group by ID
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
| 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.
| GroupToTakeStateFrom | the Authoritative Group to take state from |
| bMarkForSimulatedCatchup | marks Sources as needing to return to their current Time on next Prepare |
| uint8 FRootMotionSourceGroup::bHasAdditiveSources |
Whether this group has additive root motion sources
| uint8 FRootMotionSourceGroup::bHasOverrideSources |
Whether this group has override root motion sources
| uint8 FRootMotionSourceGroup::bHasOverrideSourcesWithIgnoreZAccumulate |
Whether this group has override root motion sources that have IgnoreZAccumulate flag
| uint8 FRootMotionSourceGroup::bIsAdditiveVelocityApplied |
True when we had additive velocity applied last tick, checked to know if we should restore LastPreAdditiveVelocity before a Velocity computation
| FRootMotionSourceSettings FRootMotionSourceGroup::LastAccumulatedSettings |
Aggregate Settings of the last group of accumulated sources
| 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
| TArray< TSharedPtr<FRootMotionSource> > FRootMotionSourceGroup::PendingAddRootMotionSources |
Root Motion Sources to be added next frame
| TArray< TSharedPtr<FRootMotionSource> > FRootMotionSourceGroup::RootMotionSources |
Root Motion Sources currently applied in this Group