`
aigo
  • 浏览: 2569318 次
  • 性别: Icon_minigender_1
  • 来自: 宜昌
社区版块
存档分类
最新评论

[UE4]FMath::RInterpConstantTo用法

UE4 
阅读更多

 

官方文档:
FMath::RInterpConstantTo

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Math/FMath/RInterpConstantTo/index.html

 

例子:

bool UShipMovementComponent::AcceptTurnToRotator(const FRotator& RotateTo)
{
    if(FMath::Abs(RotateTo.Yaw - UpdatedComponent->GetComponentRotation().Yaw) < 0.1f)
    {
        return true;
    }

    FRotator tmpRot = FMath::RInterpConstantTo(UpdatedComponent->GetComponentRotation(),
                                               RotateTo, GetWorld()->GetDeltaSeconds(),
                                               AngularSpeed);
    AcceptedRotator = tmpRot;

    return false;
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics