好的,所以我現在正在學習一個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