好的,所以我现在正在学习一个Unreal Engine programming tutorial。这是我很困惑的代码:虚幻引擎初学者FMath :: Sin
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++到不理解什么是'::',等等。 – PaulMcKenzie