engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | Protected 成员函数 | 静态 Protected 成员函数 | 所有成员列表
FRootMotionSourceGroup结构体 参考

Group of Root Motion Sources that are applied 更多...

#include <RootMotionSource.h>

Public 成员函数

void AccumulateAdditiveRootMotionVelocity (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 Helper function for accumulating additive velocity into InOutVelocity
 
void AccumulateOverrideRootMotionVelocity (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 Helper function for accumulating override velocity into InOutVelocity
 
void AddStructReferencedObjects (class FReferenceCollector &Collector)
 Exposes references to GC system
 
uint16 ApplyRootMotionSource (TSharedPtr< FRootMotionSource > SourcePtr)
 Apply a RootMotionSource to this Group 更多...
 
void ApplyTimeStampReset (float DeltaTime)
 Applies a reset to the start time for each root motion when the time stamp is reset
 
void Clear ()
 Clear the contents to return it to "empty"
 
void CullInvalidSources ()
 Removes any Sources without a valid ID
 
bool 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 > GetRootMotionSource (FName InstanceName)
 Get a RootMotionSource from this Group by name
 
TSharedPtr< FRootMotionSource > GetRootMotionSourceByID (uint16 RootMotionSourceID)
 Get a RootMotionSource from this Group by ID
 
bool HasActiveRootMotionSources () const
 
bool HasAdditiveVelocity () const
 
bool HasOverrideVelocity () const
 
bool HasOverrideVelocityWithIgnoreZAccumulate () const
 
bool HasRootMotionToApply () const
 
bool HasVelocity () const
 
bool NeedsSimulatedSmoothing () const
 Gets whether any active root motion source has been marked to need NetworkSmoothing as a SimulatedProxy
 
bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 Serialize the root motion sources and their states for this group
 
bool operator!= (const FRootMotionSourceGroup &Other) const
 Comparison operator
 
FRootMotionSourceGroup & operator= (const FRootMotionSourceGroup &Other)
 Copy operator - deep copy so it can be used for archiving/saving off moves
 
bool operator== (const FRootMotionSourceGroup &Other) const
 Comparison operator - needs matching Sources along with identical states in those sources
 
void PrepareRootMotion (float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &InMoveComponent, bool bForcePrepareAll=false)
 Generates root motion by accumulating transforms through current root motion sources. 更多...
 
void RemoveRootMotionSource (FName InstanceName)
 Remove a RootMotionSource from this Group by name
 
void RemoveRootMotionSourceByID (uint16 RootMotionSourceID)
 Remove a RootMotionSource from this Group by ID
 
void 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
 
void UpdateStateFrom (const FRootMotionSourceGroup &GroupToTakeStateFrom, bool bMarkForSimulatedCatchup=false)
 Update contained Sources to state in matching sources from other group. 更多...
 

Public 属性

uint8 bHasAdditiveSources:1
 Whether this group has additive root motion sources
 
uint8 bHasOverrideSources:1
 Whether this group has override root motion sources
 
uint8 bHasOverrideSourcesWithIgnoreZAccumulate:1
 Whether this group has override root motion sources that have IgnoreZAccumulate flag
 
uint8 bIsAdditiveVelocityApplied:1
 True when we had additive velocity applied last tick, checked to know if we should restore LastPreAdditiveVelocity before a Velocity computation
 
FRootMotionSourceSettings LastAccumulatedSettings
 Aggregate Settings of the last group of accumulated sources
 
FVector_NetQuantize10 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. 更多...
 
TArray< TSharedPtr< FRootMotionSource > > PendingAddRootMotionSources
 Root Motion Sources to be added next frame
 
TArray< TSharedPtr< FRootMotionSource > > RootMotionSources
 Root Motion Sources currently applied in this Group
 

Protected 成员函数

void AccumulateRootMotionVelocity (ERootMotionAccumulateMode RootMotionType, float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group
 
void AccumulateRootMotionVelocityFromSource (const FRootMotionSource &RootMotionSource, float DeltaTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent, FVector &InOutVelocity) const
 Accumulates contributions for velocity into InOutVelocity for a given type of root motion from this group
 

静态 Protected 成员函数

static void NetSerializeRMSArray (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess, TArray< TSharedPtr< FRootMotionSource > > &RootMotionSourceArray)
 Helper function for serializing array of root motion sources
 

详细描述

Group of Root Motion Sources that are applied

成员函数说明

◆ ApplyRootMotionSource()

uint16 FRootMotionSourceGroup::ApplyRootMotionSource ( TSharedPtr< FRootMotionSource >  SourcePtr)

Apply a RootMotionSource to this Group

返回
LocalID for this RMS

◆ HasActiveRootMotionSources()

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

◆ HasAdditiveVelocity()

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

◆ HasOverrideVelocity()

bool FRootMotionSourceGroup::HasOverrideVelocity ( ) const
返回
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
返回
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
返回
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
返回
true if any axis of velocity is modified by root motion 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.

参数
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.

◆ 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.

参数
GroupToTakeStateFromthe Authoritative Group to take state from
bMarkForSimulatedCatchupmarks Sources as needing to return to their current Time on next Prepare
返回
whether it successfully updated state

类成员变量说明

◆ 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


该结构体的文档由以下文件生成: