Header merge & CScriptPickup progress

Former-commit-id: 45c5450376
This commit is contained in:
2022-10-05 19:06:15 -04:00
parent b95f4a88b2
commit a578b055a2
55 changed files with 542 additions and 313 deletions

View File

@@ -0,0 +1,51 @@
#ifndef _CABSANGLE_HPP
#define _CABSANGLE_HPP
#include "types.h"
#include "Kyoto/Math/CMath.hpp"
class CAbsAngle {
public:
f32 AsDegrees() const { return x0_angle * (180.f / M_PIF); }
f32 AsRadians() const { return x0_angle; }
// ArcCosine__9CAbsAngleFf weak
// -> calls ArcCosineR__5CMathFf
CAbsAngle& operator+=(const CAbsAngle& v) {
x0_angle += v.x0_angle;
return *this;
}
CAbsAngle& operator-=(const CAbsAngle& v) {
x0_angle -= v.x0_angle;
return *this;
}
CAbsAngle& operator*=(f32 v) {
x0_angle *= v;
return *this;
}
CAbsAngle& operator/=(f32 v) {
x0_angle /= v;
return *this;
}
// __apl__9CAbsAngleFRC9CRelAngle
// __ami__9CAbsAngleFRC9CRelAngle
static CAbsAngle FromDegrees(f32 deg) {
return CAbsAngle(CMath::ClampRadians(deg * (M_PIF / 180.f)));
}
static CAbsAngle FromRadians(f32 rad) { return CAbsAngle(CMath::ClampRadians(rad)); }
private:
CAbsAngle(f32 rad) : x0_angle(rad) {}
float x0_angle;
};
CHECK_SIZEOF(CAbsAngle, 0x4)
// __mi__FRC9CAbsAngleRC9CAbsAngle
static inline f32 cosine(const CAbsAngle& angle) { return cos(angle.AsRadians()); }
#endif