【发布时间】:2016-06-12 06:06:52
【问题描述】:
好的,我目前正在学习Unreal Engine programming tutorial。这是我感到困惑的代码:
void AFloatingActor::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
FVector NewLocation = GetActorLocation();
float DeltaHeight = (FMath::Sin(RunningTime + DeltaTime) - FMath::Sin(RunningTime));
NewLocation.Z += DeltaHeight * 20.0f; // Scale our height by a factor of 20
RunningTime += DeltaTime;
SetActorLocation(NewLocation);
}
我不明白它所说的部分:
void AFloatingActor::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
这部分:
float DeltaHeight = (FMath::Sin(RunningTime + DeltaTime) - FMath::Sin(RunningTime));
NewLocation.Z += DeltaHeight * 20.0f; // Scale our height by a factor of 20
它有什么作用?它是如何做到的?什么是 FMath::Sin?太混乱了。
就是这样!感谢您的宝贵时间(希望能提供帮助)!
【问题讨论】:
-
“我不明白”不能很好地描述问题所在。这可能意味着从不了解 C++ 到不了解
::的作用等等。
标签: c++ unreal-engine4