New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
Angle3.h
Go to the documentation of this file.
1#pragma once
2
3#include <utility/Angle.h>
4
5#include <math/seadVector.h>
6
7class Angle3
8{
9public:
11 {
12 }
13
14 Angle3(const Angle& x, const Angle& y, const Angle& z)
15 : mX(x)
16 , mY(y)
17 , mZ(z)
18 {
19 }
20
21 Angle3(const Angle3& other) = default;
22
23 explicit Angle3(const Angle* p)
24 : mX(p[0])
25 , mY(p[1])
26 , mZ(p[2])
27 {
28 }
29
30 explicit Angle3(const sead::Vector3i& v)
31 : mX(v.x)
32 , mY(v.y)
33 , mZ(v.z)
34 {
35 }
36
37 explicit Angle3(const sead::Vector3u& v)
38 : mX(static_cast<s32>(v.x))
39 , mY(static_cast<s32>(v.y))
40 , mZ(static_cast<s32>(v.z))
41 {
42 }
43
45 {
46 return mX;
47 }
48
49 const Angle& x() const
50 {
51 return mX;
52 }
53
55 {
56 return mY;
57 }
58
59 const Angle& y() const
60 {
61 return mY;
62 }
63
65 {
66 return mZ;
67 }
68
69 const Angle& z() const
70 {
71 return mZ;
72 }
73
75 {
76 return &mX;
77 }
78
79 operator const Angle*() const
80 {
81 return &mX;
82 }
83
85 {
86 return sead::Vector3i(s32(mX), s32(mY), s32(mZ));
87 }
88
90 {
91 return sead::Vector3u(u32(mX), u32(mY), u32(mZ));
92 }
93
95 {
96 mX = rhs.mX;
97 mY = rhs.mY;
98 mZ = rhs.mZ;
99 return *this;
100 }
101
103 {
104 mX += rhs.mX;
105 mY += rhs.mY;
106 mZ += rhs.mZ;
107 return *this;
108 }
109
111 {
112 mX -= rhs.mX;
113 mY -= rhs.mY;
114 mZ -= rhs.mZ;
115 return *this;
116 }
117
119 {
120 return *this;
121 }
122
124 {
125 return Angle3(-mX, -mY, -mZ);
126 }
127
129 {
130 return Angle3(mX + rhs.mX, mY + rhs.mY, mZ + rhs.mZ);
131 }
132
134 {
135 return Angle3(mX - rhs.mX, mY - rhs.mY, mZ - rhs.mZ);
136 }
137
138 bool operator==(const Angle3& rhs) const
139 {
140 return mX == rhs.mX && mY == rhs.mY && mZ == rhs.mZ;
141 }
142
143 bool operator!=(const Angle3& rhs) const
144 {
145 return mX != rhs.mX || mY != rhs.mY || mZ != rhs.mZ;
146 }
147
148protected:
152};
153static_assert(sizeof(Angle3) == 0xC);
Definition Angle3.h:8
Angle & x()
Definition Angle3.h:44
Angle3(const sead::Vector3i &v)
Definition Angle3.h:30
Angle & y()
Definition Angle3.h:54
const Angle & y() const
Definition Angle3.h:59
Angle3(const Angle &x, const Angle &y, const Angle &z)
Definition Angle3.h:14
Angle3(const Angle *p)
Definition Angle3.h:23
const Angle & x() const
Definition Angle3.h:49
Angle3(const Angle3 &other)=default
Angle3()
Definition Angle3.h:10
Angle mZ
Definition Angle3.h:151
const Angle & z() const
Definition Angle3.h:69
Angle mY
Definition Angle3.h:150
Angle & z()
Definition Angle3.h:64