RelativeSpeed = FMath::Clamp<float>(RelativeSpeed, -1, +1);
auto ElevationChange = RelativeSpeed * MaxDegreesPerSecond * GetWorld()->DeltaTimeSeconds;
auto RawNewElevation = RelativeRotation.Pitch + ElevationChange;
auto Elevation = FMath::Clamp<float>(RawNewElevation, MinElevationDegrees, MaxElevationDegrees);
SetRelativeRotation(FRotator(Elevation, 0, 0));
Can someone explain the math side of this code, plz?
and why we need DeltaRotator.Pitch? why we can’t pass AimRotation.Pitch as the endpoint?
Please, explain it to me as if I were a machine.