engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FRootMotionSource_ConstantForce结构体 参考

ConstantForce applies a fixed force to the target 更多...

#include <RootMotionSource.h>

+ 类 FRootMotionSource_ConstantForce 继承关系图:

Public 成员函数

virtual FRootMotionSource * Clone () const override
 
virtual bool Matches (const FRootMotionSource *Other) const override
 
virtual bool MatchesAndHasSameState (const FRootMotionSource *Other) const override
 Checks that it Matches() and has the same state (time, track position, etc.)
 
virtual void PrepareRootMotion (float SimulationTime, float MovementTickTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent) override
 Generates the RootMotion for this Source, can be used for both "live" generation or for playback (client prediction correction, simulated proxies, etc.) 更多...
 
virtual bool UpdateStateFrom (const FRootMotionSource *SourceToTakeStateFrom, bool bMarkForSimulatedCatchup=false) override
 Mainly for server correction purposes - update this Source's state from another's, usually the authoritative state from the server's version of the Source 更多...
 
- Public 成员函数 继承自 FRootMotionSource
virtual void CheckTimeOut ()
 Checks if this source has timed out and marks for removal if necessary
 
virtual FRootMotionSource * Clone () const
 
float GetDuration () const
 
float GetStartTime () const
 
float GetTime () const
 
virtual bool IsActive () const
 True when this RootMotionSource should be affecting root motion
 
bool IsStartTimeValid () const
 
virtual bool IsTimeOutEnabled () const
 
virtual bool Matches (const FRootMotionSource *Other) const
 
virtual bool MatchesAndHasSameState (const FRootMotionSource *Other) const
 Checks that it Matches() and has the same state (time, track position, etc.)
 
virtual void PrepareRootMotion (float SimulationTime, float MovementTickTime, const ACharacter &Character, const UCharacterMovementComponent &MoveComponent)
 Generates the RootMotion for this Source, can be used for both "live" generation or for playback (client prediction correction, simulated proxies, etc.) 更多...
 
virtual void SetTime (float NewTime)
 Set the CurrentTime of this source. 更多...
 
virtual bool UpdateStateFrom (const FRootMotionSource *SourceToTakeStateFrom, bool bMarkForSimulatedCatchup=false)
 Mainly for server correction purposes - update this Source's state from another's, usually the authoritative state from the server's version of the Source 更多...
 

额外继承的成员函数

- Public 属性 继承自 FRootMotionSource
ERootMotionAccumulateMode AccumulateMode
 Accumulation mode for this source (whether or not to additively apply this root motion or override completely)
 
bool bInLocalSpace
 True when this RootMotionSource is contributing local space accumulation (false for world space)
 
bool bNeedsSimulatedCatchup
 True when this RootMotionSource has been marked for simulated catchup - this Simulated version of the Source needs to catch up to where it was before being corrected by authoritative version.
 
bool bSimulatedNeedsSmoothing
 True when this RootMotionSource is running on a SimulatedProxy and has marked itself as needing location/rotation smoothing. 更多...
 
float CurrentTime
 Time elapsed so far for this source
 
float Duration
 The length of this root motion - < 0 for infinite (to be removed manually)
 
FRootMotionFinishVelocitySettings FinishVelocityParams
 Finish Velocity Parameters
 
FName InstanceName
 This name allows us to find the source later so that we can end it.
 
uint16 LocalID
 ID local to this client or server instance. 更多...
 
float PreviousTime
 The last Time entry we had before the last SetTime() - used for simulated catchup
 
uint16 Priority
 Priority of this source relative to other sources - higher number being the highest priority/first applied.
 
FRootMotionMovementParams RootMotionParams
 Root Motion generated by this Source
 
FRootMotionSourceSettings Settings
 Settings of this source
 
float StartTime
 Time this source should start (in character movement client time) This is used to handle cases of inconsistent tick times (ServerMoves ticking for 1 second when root motion should have only applied for the last 0.1 seconds, or root motion source ending halfway through a 0.5 second tick)
 
FRootMotionSourceStatus Status
 Status of this source
 

详细描述

ConstantForce applies a fixed force to the target

成员函数说明

◆ Clone()

virtual FRootMotionSource * FRootMotionSource_ConstantForce::Clone ( ) const
overridevirtual
返回
newly allocated copy of this FRootMotionSource. Must be overridden by child classes.

重载 FRootMotionSource .

◆ Matches()

virtual bool FRootMotionSource_ConstantForce::Matches ( const FRootMotionSource *  Other) const
overridevirtual
返回
Whether this is the same RootMotionSource as Other. This is used for networking when clients receive RootMotionSource data from the server and need to decide which local RootMotionSource to compare and apply the corrections to. This is required due to RootMotionSources in general being added independently on server and clients, not needing to know about each other by default.

For well-networked RootMotionSources, any given FRootMotionSource child class could implement their own unique ID and simply use that in the Matches check. This "heuristic-style" default was chosen to simplify addition of new RootMotionSources, and assumes that in a networked setting a given RootMotionSource won't be applied many times in a given frame by the same instigator to the same target with the exact same parameters.

Guaranteed uniqueness would also require a strict application order ("RootMotionSources can only be added on Authority") or a prediction-based setup ("Apply on Autonomous and Simulated predictively, then apply on Authority and confirm, and if Authority doesn't confirm remove them"). We avoid that synchronization complexity for now.

See UCharacterMovementComponent::ConvertRootMotionServerIDsToLocalIDs

Should be overridden by child classes, as default implementation only contains basic equivalency checks

重载 FRootMotionSource .

◆ PrepareRootMotion()

virtual void FRootMotionSource_ConstantForce::PrepareRootMotion ( float  SimulationTime,
float  MovementTickTime,
const ACharacter &  Character,
const UCharacterMovementComponent &  MoveComponent 
)
overridevirtual

Generates the RootMotion for this Source, can be used for both "live" generation or for playback (client prediction correction, simulated proxies, etc.)

Examples:

  • Animation RootMotionSources use Time as track time into AnimMontage and extract the root motion from AnimMontage chunk of time (Position,Position+DeltaTime)
  • ConstantForce source uses Time as the time into the application so if its duration ends halfway through the frame it knows how much root motion it should have applied
  • Spline/curve-based sources use Time for knowing where on spline/curve to extract from
    参数
    SimulationTimeHow far forward in time to simulate root motion
    MovementTickTimeHow much time the movement is going to take that this is being prepared for

重载 FRootMotionSource .

◆ UpdateStateFrom()

virtual bool FRootMotionSource_ConstantForce::UpdateStateFrom ( const FRootMotionSource *  SourceToTakeStateFrom,
bool  bMarkForSimulatedCatchup = false 
)
overridevirtual

Mainly for server correction purposes - update this Source's state from another's, usually the authoritative state from the server's version of the Source

参数
bMarkForSimulatedCatchupsets the source for needing to "catch up" to current state next Prepare
返回
Whether the update was sucessful or not. Note that failure to update denotes a complete failure, and the Source will then be marked for removal. We need to remove since we don't have a way of reverting partial updates depending on where the update failed.

重载 FRootMotionSource .


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