New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
Angle.h
Go to the documentation of this file.
1#pragma once
2
3#include <basis/seadTypes.h>
4#include <math/seadMathCalcCommon.h>
5
6class Angle
7{
8public:
10 : mValue(0)
11 {
12 }
13
14 Angle(s32 value)
15 : mValue(value)
16 {
17 }
18
19 explicit Angle(f32 degrees)
21 {
22 }
23
24 Angle(const Angle& other) = default;
25
26 operator s32() const
27 {
28 return mValue;
29 }
30
32 {
34 return *this;
35 }
36
38 {
39 mValue += rhs.mValue;
40 return *this;
41 }
42
44 {
45 mValue -= rhs.mValue;
46 return *this;
47 }
48
49 Angle operator+() const
50 {
51 return *this;
52 }
53
54 Angle operator-() const
55 {
56 return Angle(-mValue);
57 }
58
60 {
61 return mValue + rhs.mValue;
62 }
63
65 {
66 return mValue + rhs;
67 }
68
70 {
71 return mValue - rhs.mValue;
72 }
73
75 {
76 return mValue - rhs;
77 }
78
79 bool operator==(const Angle& rhs) const
80 {
81 return mValue == rhs.mValue;
82 }
83
84 bool operator==(s32 rhs) const
85 {
86 return mValue == rhs;
87 }
88
89 bool operator!=(const Angle& rhs) const
90 {
91 return mValue != rhs.mValue;
92 }
93
94 bool operator!=(s32 rhs) const
95 {
96 return mValue != rhs;
97 }
98
99public:
100 // Address: 0x029E0EA8
101 bool addCalcAngle(const Angle& target, f32 ratio, const Angle& max);
102 // Address: 0x029E0EE8
103 bool addCalcAngle(const Angle& target, f32 ratio, const Angle& max, const Angle& min);
104 // Address: 0x029E116C
105 bool chaseDecrease(const Angle& target, f32 ratio, const Angle& max, const Angle& min);
106 // Address: 0x029E117C
107 bool chaseRest(const Angle& target, const Angle& step);
108 // Address: 0x029E1188
109 bool chaseConstant(const Angle& target, const Angle& step);
110
111protected:
112 // Address: 0x029E0E34
113 bool addCalcAngle_(s32 target, s32 distance, f32 ratio, s32 max, s32 min);
114 // Address: 0x029E0F8C
115 bool chaseDecrease_(s32 target, f32 ratio, s32 max, s32 min);
116 // Address: 0x029E0DE8
117 bool chaseRest_(s32 target, s32 step);
118 // Address: 0x029E0F2C
119 bool chaseConstant_(s32 target, s32 step);
120
121protected:
123};
124static_assert(sizeof(Angle) == 4);
Definition Angle.h:7
bool chaseConstant_(s32 target, s32 step)
bool chaseDecrease_(s32 target, f32 ratio, s32 max, s32 min)
bool chaseRest_(s32 target, s32 step)
bool addCalcAngle_(s32 target, s32 distance, f32 ratio, s32 max, s32 min)
bool chaseRest(const Angle &target, const Angle &step)
s32 mValue
Definition Angle.h:122
Angle(const Angle &other)=default
bool chaseConstant(const Angle &target, const Angle &step)
bool addCalcAngle(const Angle &target, f32 ratio, const Angle &max, const Angle &min)
Angle()
Definition Angle.h:9
bool chaseDecrease(const Angle &target, f32 ratio, const Angle &max, const Angle &min)
Angle(s32 value)
Definition Angle.h:14