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
10
15void mDoMtx_ZrotS(Mtx, s16);
16void mDoMtx_YrotS(Mtx, s16);
17void mDoMtx_XrotS(Mtx, s16);
18void mDoMtx_XrotM(Mtx, s16);
19void mDoMtx_YrotM(Mtx, s16);
20void mDoMtx_ZrotM(Mtx, s16);
22void mDoMtx_lookAt(Mtx param_0, Vec const* param_1, Vec const* param_2, s16 param_3);
23void mDoMtx_lookAt(Mtx param_0, Vec const* param_1, Vec const* param_2, Vec const* param_3,
24 s16 param_4);
25void mDoMtx_concatProjView(f32 const (*param_0)[4], f32 const (*param_1)[4], f32 (*param_2)[4]);
26void mDoMtx_ZrotM(Mtx mtx, s16 z);
27bool mDoMtx_inverseTranspose(f32 const (*param_0)[4], f32 (*param_1)[4]);
28void mDoMtx_QuatConcat(Quaternion const* param_0, Quaternion const* param_1, Quaternion* param_2);
29
30inline void mDoMtx_multVecSR(const Mtx m, const Vec* src, Vec* dst) {
31 MTXMultVecSR(m, src, dst);
32}
33
34inline void mDoMtx_concat(const Mtx a, const Mtx b, Mtx c) {
35 PSMTXConcat(a, b, c);
36}
37
38inline void cMtx_concat(const Mtx a, const Mtx b, Mtx ab) {
39 mDoMtx_concat(a, b, ab);
40}
41
42inline void mDoMtx_multVec(CMtxP m, const Vec* src, Vec* dst) {
43 PSMTXMultVec(m, src, dst);
44}
45
46inline void mDoMtx_multVecArray(const Mtx m, const Vec* src, Vec* dst, u32 count) {
47 PSMTXMultVecArray(m, src, dst, count);
48}
49
50inline void mDoMtx_copy(const Mtx src, Mtx dst) {
51 PSMTXCopy(src, dst);
52}
53
54inline void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z) {
55 MTXTrans(m, x, y, z);
56}
57
58inline void cMtx_XrotM(Mtx mtx, s16 x) {
60}
61
62inline void cMtx_YrotM(Mtx mtx, s16 y) {
64}
65
66inline void cMtx_ZrotM(Mtx mtx, s16 z) {
68}
69
70inline void cMtx_XrotS(Mtx mtx, s16 x) {
72}
73
74inline void cMtx_YrotS(Mtx mtx, s16 y) {
76}
77
78inline void cMtx_ZrotS(Mtx mtx, s16 z) {
80}
81
82inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, s16 param_3) {
83 mDoMtx_lookAt(param_0, param_1, param_2, param_3);
84}
85
86inline void cMtx_multVec(const Mtx mtx, const Vec* src, Vec* dst) {
87 mDoMtx_multVec(mtx, src, dst);
88}
89
90inline void cMtx_multVecSR(const Mtx mtx, const Vec* src, Vec* dst) {
92}
93
94inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, const Vec* param_3, s16 param_4) {
95 mDoMtx_lookAt(param_0,param_1,param_2,param_3,param_4);
96}
97
98inline void cMtx_copy(const Mtx src, Mtx dst) {
99 mDoMtx_copy(src, dst);
100}
101
102inline void cMtx_trans(Mtx pDest, f32 x, f32 y, f32 z) {
103 mDoMtx_trans(pDest, x, y, z);
104}
105
106inline void cMtx_multVecArray(const Mtx mtx, const Vec* src, Vec* dst, u32 count) {
107 mDoMtx_multVecArray(mtx, src, dst, count);
108}
109
110inline void cMtx_inverseTranspose(const Mtx a, Mtx b) {
112}
113
114inline void mDoMtx_multVecZero(CMtxP param_0, Vec* param_1) {
115 param_1->x = param_0[0][3];
116 param_1->y = param_0[1][3];
117 param_1->z = param_0[2][3];
118}
119
120inline void mDoMtx_quatMultiply(const Quaternion* a, const Quaternion* b, Quaternion* ab) {
121 QUATMultiply(a,b,ab);
122}
123
124inline void mDoMtx_quatSlerp(const Quaternion* a, const Quaternion* b, Quaternion* ab, f32 param_4) {
125 C_QUATSlerp(a,b,ab,param_4);
126}
127
128inline void mDoMtx_quatRotAxisRad(Quaternion* q, const Vec* axis, f32 rad) {
129 C_QUATRotAxisRad(q, axis, rad);
130}
131
132inline void mDoMtx_identity(Mtx m) {
134}
135
136inline void mDoMtx_inverse(const Mtx a, Mtx b) {
137 MTXInverse(a, b);
138}
139
140inline void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
141 MTXScale(m, x, y, z);
142}
143
144inline void cMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
145 mDoMtx_scale(m, x, y, z);
146}
147
148inline void mDoMtx_quat(Mtx m, const Quaternion* q) {
149 MTXQuat(m, q);
150}
151
152inline void cMtx_identity(Mtx mtx) {
154}
155
156inline void cMtx_inverse(const Mtx a, Mtx b) {
157 mDoMtx_inverse(a, b);
158}
159
160inline void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c) {
162}
163
165public:
167 next = buffer;
168 end = buffer + 16;
169 }
170
171 static bool push();
172 static bool pop();
173
178 static void transS(cXyz const& xyz);
179
184 static void transM(cXyz const& xyz);
185
192 static void transM(f32 x, f32 y, f32 z);
193
198 static void scaleS(cXyz const& xyz);
199
204 static void scaleM(cXyz const& xyz);
205
212 static void scaleM(f32 x, f32 y, f32 z);
213
214 static void XYZrotS(csXyz const& xyz);
215
220 static void XYZrotM(csXyz const& xyz);
221
222 static void ZXYrotS(csXyz const& xyz);
223
228 static void ZXYrotM(csXyz const& xyz);
229
230 static void quatS(const Quaternion* quat) {
231 MTXQuat(now, quat);
232 }
233
234 static void quatM(Quaternion const*);
235 ~mDoMtx_stack_c() {} // inline
236
241 static MtxP get() { return now; }
242
249 static void transS(f32 x, f32 y, f32 z) { MTXTrans(now, x, y, z); }
250
257 static void scaleS(f32 x, f32 y, f32 z) { MTXScale(now, x, y, z); }
258
264 static void multVec(const Vec* a, Vec* b) { PSMTXMultVec(now, a, b); }
265
271 static void multVecSR(const Vec* a, Vec* b) { MTXMultVecSR(now, a, b); }
272
274
281 static void multVecArray(const Vec* src, Vec* dst, u32 count) {
282 PSMTXMultVecArray(now, src, dst, count);
283 }
284
285 static void XYZrotS(s16 x, s16 y, s16 z) { mDoMtx_XYZrotS(now, x, y, z); }
286
293 static void XYZrotM(s16 x, s16 y, s16 z) { mDoMtx_XYZrotM(now, x, y, z); }
294
295 static void ZXYrotS(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotS(now, x, y, z); }
296
303 static void ZXYrotM(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotM(now, x, y, z); }
304
309 static void YrotM(s16 y) { mDoMtx_YrotM(now, y); }
310
315 static void YrotS(s16 y) { mDoMtx_YrotS(now, y); }
316
321 static void XrotS(s16 x) { mDoMtx_XrotS(now, x); }
322
327 static void XrotM(s16 x) { mDoMtx_XrotM(now, x); }
328
333 static void ZrotS(s16 z) { mDoMtx_ZrotS(now, z); }
334
339 static void ZrotM(s16 z) { mDoMtx_ZrotM(now, z); }
340
341 static void inverse() { PSMTXInverse(now, now); }
342
344
349 static void concat(const Mtx m) { MTXConcat(now, m, now); }
350
351 static void revConcat(const Mtx m) { MTXConcat(m, now, now); }
352
357 static void copy(const Mtx m) { PSMTXCopy(m, now); }
358
359 static void rotAxisRadS(const Vec* axis, f32 rad) {
360 MTXRotAxisRad(now, axis, rad);
361 }
362
363 static void identity() {
365 }
366
367 static Mtx now;
368 static Mtx buffer[16];
369 static Mtx* next;
370 static Mtx* end;
371};
372
374
376 return g_mDoMtx_identity;
377}
378
380 return mDoMtx_getIdentity();
381}
382
384public:
390 ~mDoMtx_quatStack_c() {} // inline
391
392 /* 0x000 */ Quaternion* field_0x0;
394 /* 0x014 */ Quaternion field_0x14[16];
396 /* 0x118 */ Quaternion** field_0x118;
397}; // Size: 0x11C
398
399#endif /* M_DO_M_DO_MTX_H */
static Mtx mtx[10]
Definition c_lib.cpp:486
Ordon Goat.
Definition c_sxyz.h:10
Definition m_Do_mtx.h:383
Quaternion field_0x14[16]
Definition m_Do_mtx.h:394
Quaternion ** field_0x118
Definition m_Do_mtx.h:396
Quaternion * field_0x0
Definition m_Do_mtx.h:392
mDoMtx_quatStack_c()
Definition m_Do_mtx.h:385
Quaternion field_0x4
Definition m_Do_mtx.h:393
Quaternion * field_0x114
Definition m_Do_mtx.h:395
~mDoMtx_quatStack_c()
Definition m_Do_mtx.h:390
Definition m_Do_mtx.h:164
static void rotAxisRadS(const Vec *axis, f32 rad)
Definition m_Do_mtx.h:359
static void XrotM(s16 x)
Definition m_Do_mtx.h:327
static bool push()
Definition m_Do_mtx.cpp:340
static void inverseTranspose()
Definition m_Do_mtx.h:343
static void scaleS(cXyz const &xyz)
Definition m_Do_mtx.cpp:374
static void transM(cXyz const &xyz)
Definition m_Do_mtx.cpp:370
static void identity()
Definition m_Do_mtx.h:363
static void ZrotM(s16 z)
Definition m_Do_mtx.h:339
mDoMtx_stack_c()
Definition m_Do_mtx.h:166
static void multVecSR(const Vec *a, Vec *b)
Definition m_Do_mtx.h:271
static void transS(f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:249
static void XYZrotM(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:293
static void inverse()
Definition m_Do_mtx.h:341
static void concat(const Mtx m)
Definition m_Do_mtx.h:349
static bool pop()
Definition m_Do_mtx.cpp:350
static Mtx * end
Definition m_Do_mtx.h:370
static void XYZrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:388
static MtxP get()
Definition m_Do_mtx.h:241
static void ZXYrotM(csXyz const &xyz)
Definition m_Do_mtx.cpp:400
static void ZXYrotM(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:303
static void ZrotS(s16 z)
Definition m_Do_mtx.h:333
static void ZXYrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:396
static void YrotM(s16 y)
Definition m_Do_mtx.h:309
static void multVec(const Vec *a, Vec *b)
Definition m_Do_mtx.h:264
static void XYZrotM(csXyz const &xyz)
Definition m_Do_mtx.cpp:392
static Mtx now
Definition m_Do_mtx.h:367
static Mtx buffer[16]
Definition m_Do_mtx.h:368
static void ZXYrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:295
static void transS(cXyz const &xyz)
Definition m_Do_mtx.cpp:360
static void scaleS(f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:257
~mDoMtx_stack_c()
Definition m_Do_mtx.h:235
static void YrotS(s16 y)
Definition m_Do_mtx.h:315
static void quatS(const Quaternion *quat)
Definition m_Do_mtx.h:230
static void multVecArray(const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:281
static void copy(const Mtx m)
Definition m_Do_mtx.h:357
static void scaleM(cXyz const &xyz)
Definition m_Do_mtx.cpp:384
static void quatM(Quaternion const *)
Definition m_Do_mtx.cpp:404
static void multVecZero(Vec *v)
Definition m_Do_mtx.h:273
static void XYZrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:285
static void XrotS(s16 x)
Definition m_Do_mtx.h:321
static Mtx * next
Definition m_Do_mtx.h:369
static void revConcat(const Mtx m)
Definition m_Do_mtx.h:351
asm u32 PSMTXInverse(const __REGISTER Mtx src, __REGISTER Mtx inv)
Definition mtx.c:391
asm void PSMTXCopy(const __REGISTER Mtx src, __REGISTER Mtx dst)
Definition mtx.c:63
asm void PSMTXConcat(const __REGISTER Mtx a, const __REGISTER Mtx b, __REGISTER Mtx ab)
Definition mtx.c:112
void PSMTXIdentity(__REGISTER Mtx m)
Definition mtx.c:26
asm void PSMTXMultVec(const __REGISTER Mtx m, const __REGISTER Vec *src, __REGISTER Vec *dst)
Definition mtxvec.c:20
asm void PSMTXMultVecArray(const __REGISTER Mtx m, const __REGISTER Vec *srcBase, __REGISTER Vec *dstBase, __REGISTER u32 count)
Definition mtxvec.c:66
void C_QUATSlerp(const Quaternion *p, const Quaternion *q, Quaternion *r, f32 t)
Definition quat.c:421
void C_QUATRotAxisRad(Quaternion *r, const Vec *axis, f32 rad)
Definition quat.c:343
const f32(* CMtxP)[4]
Definition mtx.h:39
f32 Mtx[3][4]
Definition mtx.h:25
f32(* MtxP)[4]
Definition mtx.h:38
const void * src
Definition __os.h:116
q
Definition e_acos.c:104
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
z
Definition e_log.c:139
double v
Definition e_pow.c:114
unsigned long u32
Definition types.h:12
signed short int s16
Definition types.h:9
float f32
Definition types.h:25
unsigned char u8
Definition types.h:8
a
Definition k_cos.c:89
void cMtx_YrotS(Mtx mtx, s16 y)
Definition m_Do_mtx.h:74
void mDoMtx_ZXYrotM(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:94
void cMtx_identity(Mtx mtx)
Definition m_Do_mtx.h:152
void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:54
void mDoMtx_multVec(CMtxP m, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:42
u8 g_printCurrentHeapDebug
void mDoMtx_identity(Mtx m)
Definition m_Do_mtx.h:132
void mDoMtx_MtxToRot(CMtxP, csXyz *)
Definition m_Do_mtx.cpp:322
void mDoMtx_concat(const Mtx a, const Mtx b, Mtx c)
Definition m_Do_mtx.h:34
void mDoMtx_ZXYrotS(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:75
void mDoMtx_XrotM(Mtx, s16)
Definition m_Do_mtx.cpp:132
void mDoMtx_quatSlerp(const Quaternion *a, const Quaternion *b, Quaternion *ab, f32 param_4)
Definition m_Do_mtx.h:124
void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c)
Definition m_Do_mtx.h:160
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:144
Mtx g_mDoMtx_identity
Definition m_Do_mtx.cpp:26
void mDoMtx_quat(Mtx m, const Quaternion *q)
Definition m_Do_mtx.h:148
void mDoMtx_ZrotS(Mtx, s16)
Definition m_Do_mtx.cpp:178
void mDoMtx_multVecSR(const Mtx m, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:30
void cMtx_XrotM(Mtx mtx, s16 x)
Definition m_Do_mtx.h:58
void cMtx_multVecSR(const Mtx mtx, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:90
void mDoMtx_multVecArray(const Mtx m, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:46
void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:140
void mDoMtx_XYZrotM(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:57
void mDoMtx_ZrotM(Mtx, s16)
Definition m_Do_mtx.cpp:198
void cMtx_multVec(const Mtx mtx, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:86
void cMtx_concat(const Mtx a, const Mtx b, Mtx ab)
Definition m_Do_mtx.h:38
void cMtx_XrotS(Mtx mtx, s16 x)
Definition m_Do_mtx.h:70
void mDoMtx_QuatConcat(Quaternion const *param_0, Quaternion const *param_1, Quaternion *param_2)
Definition m_Do_mtx.cpp:315
void mDoMtx_XYZrotS(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:38
void mDoMtx_inverse(const Mtx a, Mtx b)
Definition m_Do_mtx.h:136
void cMtx_ZrotS(Mtx mtx, s16 z)
Definition m_Do_mtx.h:78
void mDoMtx_YrotS(Mtx, s16)
Sets the given matrix to a rotation transformation around the Y-axis.
Definition m_Do_mtx.cpp:152
void mDoMtx_concatProjView(f32 const (*param_0)[4], f32 const (*param_1)[4], f32(*param_2)[4])
u8 g_printOtherHeapDebug
void cMtx_trans(Mtx pDest, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:102
void mDoMtx_lookAt(Mtx param_0, Vec const *param_1, Vec const *param_2, s16 param_3)
Definition m_Do_mtx.cpp:204
void cMtx_inverse(const Mtx a, Mtx b)
Definition m_Do_mtx.h:156
void cMtx_inverseTranspose(const Mtx a, Mtx b)
Definition m_Do_mtx.h:110
void mDoMtx_YrotM(Mtx, s16)
Definition m_Do_mtx.cpp:172
MtxP mDoMtx_getIdentity()
Definition m_Do_mtx.h:375
MtxP cMtx_getIdentity()
Definition m_Do_mtx.h:379
void cMtx_multVecArray(const Mtx mtx, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:106
void mDoMtx_quatRotAxisRad(Quaternion *q, const Vec *axis, f32 rad)
Definition m_Do_mtx.h:128
void mDoMtx_XrotS(Mtx, s16)
Definition m_Do_mtx.cpp:112
void mDoMtx_quatMultiply(const Quaternion *a, const Quaternion *b, Quaternion *ab)
Definition m_Do_mtx.h:120
void cMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:98
void cMtx_YrotM(Mtx mtx, s16 y)
Definition m_Do_mtx.h:62
void mDoMtx_multVecZero(CMtxP param_0, Vec *param_1)
Definition m_Do_mtx.h:114
void mDoMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:50
void cMtx_ZrotM(Mtx mtx, s16 z)
Definition m_Do_mtx.h:66
void cMtx_lookAt(Mtx param_0, const Vec *param_1, const Vec *param_2, s16 param_3)
Definition m_Do_mtx.h:82
Definition mtx.h:21
Definition mtx.h:13
f32 z
Definition mtx.h:14
f32 x
Definition mtx.h:14
f32 y
Definition mtx.h:14
Definition c_xyz.h:7