Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
m_Do_mtx.h
Go to the documentation of this file.
1#ifndef M_DO_M_DO_MTX_H
2#define M_DO_M_DO_MTX_H
3
6#include "dolphin/mtx.h"
7
12void mDoMtx_ZrotS(Mtx, s16);
13void mDoMtx_YrotS(Mtx, s16);
14void mDoMtx_XrotS(Mtx, s16);
15void mDoMtx_XrotM(Mtx, s16);
16void mDoMtx_YrotM(Mtx, s16);
17void mDoMtx_ZrotM(Mtx, s16);
19void mDoMtx_lookAt(Mtx param_0, Vec const* param_1, Vec const* param_2, s16 param_3);
20void mDoMtx_lookAt(Mtx param_0, Vec const* param_1, Vec const* param_2, Vec const* param_3,
21 s16 param_4);
22void mDoMtx_concatProjView(f32 const (*param_0)[4], f32 const (*param_1)[4], f32 (*param_2)[4]);
23void mDoMtx_ZrotM(Mtx mtx, s16 z);
26
27inline void mDoMtx_multVecSR(Mtx m, const Vec* src, Vec* dst) {
28 MTXMultVecSR(m, src, dst);
29}
30
31inline void cMtx_concat(const Mtx a, const Mtx b, Mtx ab) {
32 MTXConcat(a, b, ab);
33}
34
35inline void cMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
36 MTXScale(m, x, y, z);
37}
38
39inline void mDoMtx_multVec(Mtx m, const Vec* src, Vec* dst) {
40 MTXMultVec(m, src, dst);
41}
42
43inline void mDoMtx_multVecArray(Mtx m, const Vec* src, Vec* dst, u32 count) {
44 MTXMultVecArray(m, src, dst, count);
45}
46
47inline void mDoMtx_copy(const Mtx src, Mtx dst) {
48 MTXCopy(src, dst);
49}
50
51inline void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z) {
52 MTXTrans(m, x, y, z);
53}
54
55inline void cMtx_XrotM(Mtx mtx, s16 x) {
57}
58
59inline void cMtx_YrotM(Mtx mtx, s16 y) {
61}
62
63inline void cMtx_ZrotM(Mtx mtx, s16 z) {
65}
66
67inline void cMtx_XrotS(Mtx mtx, s16 x) {
69}
70
71inline void cMtx_YrotS(Mtx mtx, s16 y) {
73}
74
75inline void cMtx_ZrotS(Mtx mtx, s16 z) {
77}
78
79inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, s16 param_3) {
81}
82
83inline void cMtx_multVec(Mtx mtx, const Vec* src, Vec* dst) {
84 mDoMtx_multVec(mtx, src, dst);
85}
86
87inline void cMtx_multVecSR(Mtx mtx, const Vec* src, Vec* dst) {
89}
90
91inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, const Vec* param_3, s16 param_4) {
92 mDoMtx_lookAt(param_0,param_1,param_2,param_3,param_4);
93}
94
95inline void cMtx_copy(const Mtx src, Mtx dst) {
96 mDoMtx_copy(src, dst);
97}
98
99inline void cMtx_multVecArray(Mtx mtx, const Vec* src, Vec* dst, u32 count) {
100 mDoMtx_multVecArray(mtx, src, dst, count);
101}
102
104 param_1->x = param_0[0][3];
105 param_1->y = param_0[1][3];
106 param_1->z = param_0[2][3];
107}
108
109inline void mDoMtx_quatMultiply(const Quaternion* a, const Quaternion* b, Quaternion* ab) {
110 QUATMultiply(a,b,ab);
111}
112
113inline void mDoMtx_quatSlerp(const Quaternion* a, const Quaternion* b, Quaternion* ab, f32 param_4) {
114 C_QUATSlerp(a,b,ab,param_4);
115}
116
119}
120
121inline void mDoMtx_identity(Mtx m) {
122 MTXIdentity(m);
123}
124
125inline void mDoMtx_concat(const Mtx a, const Mtx b, Mtx c) {
126 MTXConcat(a, b, c);
127}
128
129inline void mDoMtx_inverse(const Mtx a, Mtx b) {
130 MTXInverse(a, b);
131}
132
133inline void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
134 MTXScale(m, x, y, z);
135}
136
137inline void mDoMtx_quat(Mtx m, const Quaternion* q) {
139}
140
141inline void cMtx_inverse(const Mtx a, Mtx b) {
142 mDoMtx_inverse(a, b);
143}
144
145inline void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c) {
147}
148
149class mDoMtx_stack_c {
150public:
152 next = buffer;
153 end = buffer + 16;
154 }
155
156 /* 8000CCC8 */ static bool push();
157 /* 8000CD14 */ static bool pop();
158
163 /* 8000CD64 */ static void transS(cXyz const& xyz);
164
169 /* 8000CDD4 */ static void transM(cXyz const& xyz);
170
177 /* 8000CD9C */ static void transM(f32 x, f32 y, f32 z);
178
183 /* 8000CE00 */ static void scaleS(cXyz const& xyz);
184
189 /* 8000CE70 */ static void scaleM(cXyz const& xyz);
190
197 /* 8000CE38 */ static void scaleM(f32 x, f32 y, f32 z);
198
199 /* 8000CE9C */ static void XYZrotS(csXyz const& xyz);
200
205 /* 8000CED4 */ static void XYZrotM(csXyz const& xyz);
206
207 /* 8000CF0C */ static void ZXYrotS(csXyz const& xyz);
208
213 /* 8000CF44 */ static void ZXYrotM(csXyz const& xyz);
214
215 static void quatS(const Quaternion* quat) {
217 }
218
219 /* 8000CF7C */ static void quatM(Quaternion const*);
220 /* 8000D070 */ ~mDoMtx_stack_c() {} // inline
221
226 static MtxP get() { return now; }
227
234 static void transS(f32 x, f32 y, f32 z) { MTXTrans(now, x, y, z); }
235
242 static void scaleS(f32 x, f32 y, f32 z) { MTXScale(now, x, y, z); }
243
249 static void multVec(const Vec* a, Vec* b) { MTXMultVec(now, a, b); }
250
256 static void multVecSR(const Vec* a, Vec* b) { MTXMultVecSR(now, a, b); }
257
259
266 static void multVecArray(const Vec* src, Vec* dst, u32 count) {
267 MTXMultVecArray(now, src, dst, count);
268 }
269
270 static void XYZrotS(s16 x, s16 y, s16 z) { mDoMtx_XYZrotS(now, x, y, z); }
271
278 static void XYZrotM(s16 x, s16 y, s16 z) { mDoMtx_XYZrotM(now, x, y, z); }
279
280 static void ZXYrotS(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotS(now, x, y, z); }
281
288 static void ZXYrotM(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotM(now, x, y, z); }
289
294 static void YrotM(s16 y) { mDoMtx_YrotM(now, y); }
295
300 static void YrotS(s16 y) { mDoMtx_YrotS(now, y); }
301
306 static void XrotS(s16 x) { mDoMtx_XrotS(now, x); }
307
312 static void XrotM(s16 x) { mDoMtx_XrotM(now, x); }
313
318 static void ZrotS(s16 z) { mDoMtx_ZrotS(now, z); }
319
324 static void ZrotM(s16 z) { mDoMtx_ZrotM(now, z); }
325
326 static void inverse() { MTXInverse(now, now); }
327
329
334 static void concat(const Mtx m) { MTXConcat(now, m, now); }
335
336 static void revConcat(const Mtx m) { MTXConcat(m, now, now); }
337
342 static void copy(const Mtx m) { MTXCopy(m, now); }
343
344 static void rotAxisRadS(const Vec* axis, f32 rad) {
346 }
347
348 static Mtx now;
349 static Mtx buffer[16];
350 static Mtx* next;
351 static Mtx* end;
352};
353
355
357 return g_mDoMtx_identity;
358}
359
361 return mDoMtx_getIdentity();
362}
363
365public:
371 ~mDoMtx_quatStack_c() {} // inline
372
373 /* 0x000 */ Quaternion* field_0x0;
375 /* 0x014 */ Quaternion field_0x14[16];
377 /* 0x118 */ Quaternion** field_0x118;
378}; // Size: 0x11C
379
380#endif /* M_DO_M_DO_MTX_H */
static Mtx mtx[10]
Definition c_lib.cpp:347
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition m_Do_mtx.h:364
Quaternion field_0x14[16]
Definition m_Do_mtx.h:375
Quaternion ** field_0x118
Definition m_Do_mtx.h:377
Quaternion * field_0x0
Definition m_Do_mtx.h:373
mDoMtx_quatStack_c()
Definition m_Do_mtx.h:366
Quaternion field_0x4
Definition m_Do_mtx.h:374
Quaternion * field_0x114
Definition m_Do_mtx.h:376
~mDoMtx_quatStack_c()
Definition m_Do_mtx.h:371
q
Definition e_acos.c:99
c
Definition e_acos.c:97
double x double x
Definition e_atan2.c:58
int m
Definition e_atan2.c:62
double x double y
Definition e_atan2.c:58
double v
Definition e_pow.c:163
z
Definition e_pow.c:390
a
Definition k_cos.c:89
void mDoMtx_multVec(Mtx m, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:39
void cMtx_YrotS(Mtx mtx, s16 y)
Definition m_Do_mtx.h:71
void mDoMtx_ZXYrotM(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:77
void cMtx_multVecSR(Mtx mtx, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:87
void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:51
void mDoMtx_multVecSR(Mtx m, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:27
void mDoMtx_identity(Mtx m)
Definition m_Do_mtx.h:121
void mDoMtx_MtxToRot(CMtxP, csXyz *)
Definition m_Do_mtx.cpp:303
void mDoMtx_concat(const Mtx a, const Mtx b, Mtx c)
Definition m_Do_mtx.h:125
void mDoMtx_ZXYrotS(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:57
void mDoMtx_XrotM(Mtx, s16)
Definition m_Do_mtx.cpp:117
void mDoMtx_quatSlerp(const Quaternion *a, const Quaternion *b, Quaternion *ab, f32 param_4)
Definition m_Do_mtx.h:113
void cMtx_multVecArray(Mtx mtx, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:99
void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c)
Definition m_Do_mtx.h:145
bool mDoMtx_inverseTranspose(f32 const (*param_0)[4], f32(*param_1)[4])
void cMtx_scale(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:35
Mtx g_mDoMtx_identity
void mDoMtx_quat(Mtx m, const Quaternion *q)
Definition m_Do_mtx.h:137
void mDoMtx_ZrotS(Mtx, s16)
Definition m_Do_mtx.cpp:152
void cMtx_XrotM(Mtx mtx, s16 x)
Definition m_Do_mtx.h:55
void mDoMtx_multVecZero(MtxP param_0, Vec *param_1)
Definition m_Do_mtx.h:103
void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:133
void mDoMtx_XYZrotM(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:38
void mDoMtx_ZrotM(Mtx, s16)
Definition m_Do_mtx.cpp:173
void cMtx_concat(const Mtx a, const Mtx b, Mtx ab)
Definition m_Do_mtx.h:31
void cMtx_XrotS(Mtx mtx, s16 x)
Definition m_Do_mtx.h:67
void cMtx_multVec(Mtx mtx, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:83
void mDoMtx_QuatConcat(Quaternion const *param_0, Quaternion const *param_1, Quaternion *param_2)
Definition m_Do_mtx.cpp:294
void mDoMtx_XYZrotS(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:18
void mDoMtx_inverse(const Mtx a, Mtx b)
Definition m_Do_mtx.h:129
void cMtx_ZrotS(Mtx mtx, s16 z)
Definition m_Do_mtx.h:75
void mDoMtx_YrotS(Mtx, s16)
Definition m_Do_mtx.cpp:124
void mDoMtx_concatProjView(f32 const (*param_0)[4], f32 const (*param_1)[4], f32(*param_2)[4])
void mDoMtx_lookAt(Mtx param_0, Vec const *param_1, Vec const *param_2, s16 param_3)
Definition m_Do_mtx.cpp:181
void mDoMtx_multVecArray(Mtx m, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:43
void cMtx_inverse(const Mtx a, Mtx b)
Definition m_Do_mtx.h:141
void mDoMtx_YrotM(Mtx, s16)
Definition m_Do_mtx.cpp:145
MtxP mDoMtx_getIdentity()
Definition m_Do_mtx.h:356
MtxP cMtx_getIdentity()
Definition m_Do_mtx.h:360
void mDoMtx_quatRotAxisRad(Quaternion *q, const Vec *axis, f32 rad)
Definition m_Do_mtx.h:117
void mDoMtx_XrotS(Mtx, s16)
Definition m_Do_mtx.cpp:96
void mDoMtx_quatMultiply(const Quaternion *a, const Quaternion *b, Quaternion *ab)
Definition m_Do_mtx.h:109
void cMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:95
void cMtx_YrotM(Mtx mtx, s16 y)
Definition m_Do_mtx.h:59
void mDoMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:47
void cMtx_ZrotM(Mtx mtx, s16 z)
Definition m_Do_mtx.h:63
void cMtx_lookAt(Mtx param_0, const Vec *param_1, const Vec *param_2, s16 param_3)
Definition m_Do_mtx.h:79
const f32(* CMtxP)[4]
Definition mtx.h:20
f32(* MtxP)[4]
Definition mtx.h:18
f32 Mtx[3][4]
Definition mtx.h:15
void C_QUATRotAxisRad(Quaternion *q, const Vec *axis, f32 rad)
Definition quat.c:48
void C_QUATSlerp(const Quaternion *p, const Quaternion *q, Quaternion *r, f32 t)
Definition quat.c:67
f32 PSQuaternion[4]
Definition quat.h:14
Definition d_a_hozelda.cpp:16
Definition d_a_hozelda.cpp:18
Definition d_a_hozelda.cpp:20
Definition d_a_ep.cpp:66
Definition d_a_hozelda.cpp:26
static void rotAxisRadS(const Vec *axis, f32 rad)
Definition m_Do_mtx.h:344
static void quatM(Quaternion const *)
static void transS(cXyz const &xyz)
static void XrotM(s16 x)
Definition m_Do_mtx.h:312
static bool push()
Definition m_Do_mtx.cpp:336
static void inverseTranspose()
Definition m_Do_mtx.h:328
static void scaleS(cXyz const &xyz)
Definition m_Do_mtx.cpp:377
static void ZrotM(s16 z)
Definition m_Do_mtx.h:324
mDoMtx_stack_c()
Definition m_Do_mtx.h:151
static void multVecSR(const Vec *a, Vec *b)
Definition m_Do_mtx.h:256
static void transS(f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:234
static void XYZrotM(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:278
static void inverse()
Definition m_Do_mtx.h:326
static void concat(const Mtx m)
Definition m_Do_mtx.h:334
static bool pop()
Definition m_Do_mtx.cpp:347
static Mtx * end
Definition m_Do_mtx.h:351
static void XYZrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:397
static MtxP get()
Definition m_Do_mtx.h:226
static void scaleM(cXyz const &xyz)
static void transM(f32 x, f32 y, f32 z)
static u8 now[48]
Definition d_a_hozelda.cpp:31
static void ZXYrotM(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:288
static void ZrotS(s16 z)
Definition m_Do_mtx.h:318
static void ZXYrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:408
static void YrotM(s16 y)
Definition m_Do_mtx.h:294
static void multVec(const Vec *a, Vec *b)
Definition m_Do_mtx.h:249
static void XYZrotM(csXyz const &xyz)
Definition m_Do_mtx.cpp:403
static Mtx now
Definition m_Do_mtx.h:348
static Mtx buffer[16]
Definition m_Do_mtx.h:349
static void ZXYrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:280
void scaleM(cXyz const &)
Definition m_Do_mtx.cpp:391
static void scaleS(f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:242
~mDoMtx_stack_c()
Definition m_Do_mtx.h:220
static void YrotS(s16 y)
Definition m_Do_mtx.h:300
static void quatS(const Quaternion *quat)
Definition m_Do_mtx.h:215
static void multVecArray(const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:266
static void copy(const Mtx m)
Definition m_Do_mtx.h:342
static void ZXYrotM(csXyz const &xyz)
void transM(f32, f32, f32)
Definition m_Do_mtx.cpp:364
static void multVecZero(Vec *v)
Definition m_Do_mtx.h:258
static void XYZrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:270
static void XrotS(s16 x)
Definition m_Do_mtx.h:306
static Mtx * next
Definition m_Do_mtx.h:350
static void revConcat(const Mtx m)
Definition m_Do_mtx.h:336
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5