mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
<feat: New project structure>
<feat: New release>
This commit is contained in:
54
dependencies/reboot/Project Reboot 3.0/Rotator.h
vendored
Normal file
54
dependencies/reboot/Project Reboot 3.0/Rotator.h
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include "Quat.h"
|
||||
#include "Vector.h"
|
||||
|
||||
#include "UnrealMathUtility.h"
|
||||
|
||||
struct FRotator
|
||||
{
|
||||
#ifdef ABOVE_S20
|
||||
double Pitch;
|
||||
double Yaw;
|
||||
double Roll;
|
||||
#else
|
||||
float Pitch;
|
||||
float Yaw;
|
||||
float Roll;
|
||||
#endif
|
||||
|
||||
FQuat Quaternion() const;
|
||||
|
||||
FVector Vector() const;
|
||||
|
||||
static float NormalizeAxis(float Angle);
|
||||
static float ClampAxis(float Angle);
|
||||
};
|
||||
|
||||
FORCEINLINE float FRotator::ClampAxis(float Angle)
|
||||
{
|
||||
// returns Angle in the range (-360,360)
|
||||
Angle = FMath::Fmod(Angle, 360.f);
|
||||
|
||||
if (Angle < 0.f)
|
||||
{
|
||||
// shift to [0,360) range
|
||||
Angle += 360.f;
|
||||
}
|
||||
|
||||
return Angle;
|
||||
}
|
||||
|
||||
FORCEINLINE float FRotator::NormalizeAxis(float Angle)
|
||||
{
|
||||
// returns Angle in the range [0,360)
|
||||
Angle = ClampAxis(Angle);
|
||||
|
||||
if (Angle > 180.f)
|
||||
{
|
||||
// shift to (-180,180]
|
||||
Angle -= 360.f;
|
||||
}
|
||||
|
||||
return Angle;
|
||||
}
|
||||
Reference in New Issue
Block a user