Root Motion 移动功能。
void UCharacterMovementComponent::SimulatedTick(float DeltaSeconds)
{
SCOPE_CYCLE_COUNTER(STAT_CharacterMovementSimulated);
checkSlow(CharacterOwner != nullptr);
if (NetworkSmoothingMode == ENetworkSmoothingMode::Replay)
{
const FVector OldLocation = UpdatedComponent ? UpdatedComponent->GetComponentLocation() : FVector::ZeroVector;
const FVector OldVelocity = Velocity;
// Interpolate between appropriate samples
{
SCOPE_CYCLE_COUNTER( STAT_CharacterMovementSmoothClientPosition );
SmoothClientPosition( DeltaSeconds );
}
// Update replicated movement mode
ApplyNetworkMovementMode( GetCharacterOwner()->GetReplicatedMovementMode() );
UpdateComponentVelocity();
bJustTeleported = false;
CharacterOwner->RootMotionRepMoves.Empty();
CurrentRootMotion.Clear();
CharacterOwner->SavedRootMotion.Clear();
// Note: we do not call the Super implementation, that runs prediction.
// We do still need to call these though
OnMovementUpdated(DeltaSeconds, OldLocation, OldVelocity);
CallMovementUpdateDelegate(DeltaSeconds, OldLocation, OldVelocity);
LastUpdateLocation = UpdatedComponent ? UpdatedComponent->GetComponentLocation() : FVector::ZeroVector;
LastUpdateRotation = UpdatedComponent ? UpdatedComponent->GetComponentQuat() : FQuat::Identity;
LastUpdateVelocity = Velocity;
//TickCharacterPose( DeltaSeconds );
return;
}
// If we are playing a RootMotion AnimMontage.


970

被折叠的 条评论
为什么被折叠?



