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);
24bool mDoMtx_inverseTranspose(f32 const (*param_0)[4], f32 (*param_1)[4]);
25void mDoMtx_QuatConcat(Quaternion const* param_0, Quaternion const* param_1, Quaternion* param_2);
26
27inline void mDoMtx_multVecSR(const Mtx m, const Vec* src, Vec* dst) {
28 MTXMultVecSR(m, src, dst);
29}
30
31inline void mDoMtx_concat(const Mtx a, const Mtx b, Mtx c) {
32 PSMTXConcat(a, b, c);
33}
34
35inline void cMtx_concat(const Mtx a, const Mtx b, Mtx ab) {
36 mDoMtx_concat(a, b, ab);
37}
38
39inline void cMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
40 MTXScale(m, x, y, z);
41}
42
43inline void mDoMtx_multVec(CMtxP m, const Vec* src, Vec* dst) {
44 PSMTXMultVec(m, src, dst);
45}
46
47inline void mDoMtx_multVecArray(const Mtx m, const Vec* src, Vec* dst, u32 count) {
48 MTXMultVecArray(m, src, dst, count);
49}
50
51inline void mDoMtx_copy(const Mtx src, Mtx dst) {
52 PSMTXCopy(src, dst);
53}
54
55inline void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z) {
56 MTXTrans(m, x, y, z);
57}
58
59inline void cMtx_XrotM(Mtx mtx, s16 x) {
61}
62
63inline void cMtx_YrotM(Mtx mtx, s16 y) {
65}
66
67inline void cMtx_ZrotM(Mtx mtx, s16 z) {
69}
70
71inline void cMtx_XrotS(Mtx mtx, s16 x) {
73}
74
75inline void cMtx_YrotS(Mtx mtx, s16 y) {
77}
78
79inline void cMtx_ZrotS(Mtx mtx, s16 z) {
81}
82
83inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, s16 param_3) {
84 mDoMtx_lookAt(param_0, param_1, param_2, param_3);
85}
86
87inline void cMtx_multVec(const Mtx mtx, const Vec* src, Vec* dst) {
88 mDoMtx_multVec(mtx, src, dst);
89}
90
91inline void cMtx_multVecSR(Mtx mtx, const Vec* src, Vec* dst) {
93}
94
95inline void cMtx_lookAt(Mtx param_0, const Vec* param_1, const Vec* param_2, const Vec* param_3, s16 param_4) {
96 mDoMtx_lookAt(param_0,param_1,param_2,param_3,param_4);
97}
98
99inline void cMtx_copy(const Mtx src, Mtx dst) {
100 mDoMtx_copy(src, dst);
101}
102
103inline void cMtx_multVecArray(const Mtx mtx, const Vec* src, Vec* dst, u32 count) {
104 mDoMtx_multVecArray(mtx, src, dst, count);
105}
106
107inline void cMtx_inverseTranspose(const Mtx a, Mtx b) {
109}
110
111inline void mDoMtx_multVecZero(CMtxP param_0, Vec* param_1) {
112 param_1->x = param_0[0][3];
113 param_1->y = param_0[1][3];
114 param_1->z = param_0[2][3];
115}
116
117inline void mDoMtx_quatMultiply(const Quaternion* a, const Quaternion* b, Quaternion* ab) {
118 QUATMultiply(a,b,ab);
119}
120
121inline void mDoMtx_quatSlerp(const Quaternion* a, const Quaternion* b, Quaternion* ab, f32 param_4) {
122 C_QUATSlerp(a,b,ab,param_4);
123}
124
125inline void mDoMtx_quatRotAxisRad(Quaternion* q, const Vec* axis, f32 rad) {
126 C_QUATRotAxisRad(q, axis, rad);
127}
128
129inline void mDoMtx_identity(Mtx m) {
131}
132
133inline void mDoMtx_inverse(const Mtx a, Mtx b) {
134 MTXInverse(a, b);
135}
136
137inline void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
138 MTXScale(m, x, y, z);
139}
140
141inline void mDoMtx_quat(Mtx m, const Quaternion* q) {
142 MTXQuat(m, q);
143}
144
145inline void cMtx_inverse(const Mtx a, Mtx b) {
146 mDoMtx_inverse(a, b);
147}
148
149inline void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c) {
151}
152
154public:
156 next = buffer;
157 end = buffer + 16;
158 }
159
160 static bool push();
161 static bool pop();
162
167 static void transS(cXyz const& xyz);
168
173 static void transM(cXyz const& xyz);
174
181 static void transM(f32 x, f32 y, f32 z);
182
187 static void scaleS(cXyz const& xyz);
188
193 static void scaleM(cXyz const& xyz);
194
201 static void scaleM(f32 x, f32 y, f32 z);
202
203 static void XYZrotS(csXyz const& xyz);
204
209 static void XYZrotM(csXyz const& xyz);
210
211 static void ZXYrotS(csXyz const& xyz);
212
217 static void ZXYrotM(csXyz const& xyz);
218
219 static void quatS(const Quaternion* quat) {
220 MTXQuat(now, quat);
221 }
222
223 static void quatM(Quaternion const*);
224 ~mDoMtx_stack_c() {} // inline
225
230 static MtxP get() { return now; }
231
238 static void transS(f32 x, f32 y, f32 z) { MTXTrans(now, x, y, z); }
239
246 static void scaleS(f32 x, f32 y, f32 z) { MTXScale(now, x, y, z); }
247
253 static void multVec(const Vec* a, Vec* b) { PSMTXMultVec(now, a, b); }
254
260 static void multVecSR(const Vec* a, Vec* b) { MTXMultVecSR(now, a, b); }
261
263
270 static void multVecArray(const Vec* src, Vec* dst, u32 count) {
271 PSMTXMultVecArray(now, src, dst, count);
272 }
273
274 static void XYZrotS(s16 x, s16 y, s16 z) { mDoMtx_XYZrotS(now, x, y, z); }
275
282 static void XYZrotM(s16 x, s16 y, s16 z) { mDoMtx_XYZrotM(now, x, y, z); }
283
284 static void ZXYrotS(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotS(now, x, y, z); }
285
292 static void ZXYrotM(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotM(now, x, y, z); }
293
298 static void YrotM(s16 y) { mDoMtx_YrotM(now, y); }
299
304 static void YrotS(s16 y) { mDoMtx_YrotS(now, y); }
305
310 static void XrotS(s16 x) { mDoMtx_XrotS(now, x); }
311
316 static void XrotM(s16 x) { mDoMtx_XrotM(now, x); }
317
322 static void ZrotS(s16 z) { mDoMtx_ZrotS(now, z); }
323
328 static void ZrotM(s16 z) { mDoMtx_ZrotM(now, z); }
329
330 static void inverse() { PSMTXInverse(now, now); }
331
333
338 static void concat(const Mtx m) { MTXConcat(now, m, now); }
339
340 static void revConcat(const Mtx m) { MTXConcat(m, now, now); }
341
346 static void copy(const Mtx m) { PSMTXCopy(m, now); }
347
348 static void rotAxisRadS(const Vec* axis, f32 rad) {
349 MTXRotAxisRad(now, axis, rad);
350 }
351
352 static void identity() {
354 }
355
356 static Mtx now;
357 static Mtx buffer[16];
358 static Mtx* next;
359 static Mtx* end;
360};
361
363
365 return g_mDoMtx_identity;
366}
367
369 return mDoMtx_getIdentity();
370}
371
373public:
379 ~mDoMtx_quatStack_c() {} // inline
380
381 /* 0x000 */ Quaternion* field_0x0;
383 /* 0x014 */ Quaternion field_0x14[16];
385 /* 0x118 */ Quaternion** field_0x118;
386}; // Size: 0x11C
387
388#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:372
Quaternion field_0x14[16]
Definition m_Do_mtx.h:383
Quaternion ** field_0x118
Definition m_Do_mtx.h:385
Quaternion * field_0x0
Definition m_Do_mtx.h:381
mDoMtx_quatStack_c()
Definition m_Do_mtx.h:374
Quaternion field_0x4
Definition m_Do_mtx.h:382
Quaternion * field_0x114
Definition m_Do_mtx.h:384
~mDoMtx_quatStack_c()
Definition m_Do_mtx.h:379
Definition m_Do_mtx.h:153
static void rotAxisRadS(const Vec *axis, f32 rad)
Definition m_Do_mtx.h:348
static void XrotM(s16 x)
Definition m_Do_mtx.h:316
static bool push()
Definition m_Do_mtx.cpp:340
static void inverseTranspose()
Definition m_Do_mtx.h:332
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:352
static void ZrotM(s16 z)
Definition m_Do_mtx.h:328
mDoMtx_stack_c()
Definition m_Do_mtx.h:155
static void multVecSR(const Vec *a, Vec *b)
Definition m_Do_mtx.h:260
static void transS(f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:238
static void XYZrotM(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:282
static void inverse()
Definition m_Do_mtx.h:330
static void concat(const Mtx m)
Definition m_Do_mtx.h:338
static bool pop()
Definition m_Do_mtx.cpp:350
static Mtx * end
Definition m_Do_mtx.h:359
static void XYZrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:388
static MtxP get()
Definition m_Do_mtx.h:230
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:292
static void ZrotS(s16 z)
Definition m_Do_mtx.h:322
static void ZXYrotS(csXyz const &xyz)
Definition m_Do_mtx.cpp:396
static void YrotM(s16 y)
Definition m_Do_mtx.h:298
static void multVec(const Vec *a, Vec *b)
Definition m_Do_mtx.h:253
static void XYZrotM(csXyz const &xyz)
Definition m_Do_mtx.cpp:392
static Mtx now
Definition m_Do_mtx.h:356
static Mtx buffer[16]
Definition m_Do_mtx.h:357
static void ZXYrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:284
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:246
~mDoMtx_stack_c()
Definition m_Do_mtx.h:224
static void YrotS(s16 y)
Definition m_Do_mtx.h:304
static void quatS(const Quaternion *quat)
Definition m_Do_mtx.h:219
static void multVecArray(const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:270
static void copy(const Mtx m)
Definition m_Do_mtx.h:346
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:262
static void XYZrotS(s16 x, s16 y, s16 z)
Definition m_Do_mtx.h:274
static void XrotS(s16 x)
Definition m_Do_mtx.h:310
static Mtx * next
Definition m_Do_mtx.h:358
static void revConcat(const Mtx m)
Definition m_Do_mtx.h:340
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
unsigned long u32
Definition types.h:12
signed short int s16
Definition types.h:9
float f32
Definition types.h:25
q
Definition e_acos.c:99
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 cMtx_YrotS(Mtx mtx, s16 y)
Definition m_Do_mtx.h:75
void mDoMtx_ZXYrotM(Mtx, s16, s16, s16)
Definition m_Do_mtx.cpp:94
void cMtx_multVecSR(Mtx mtx, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:91
void mDoMtx_trans(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:55
void mDoMtx_multVec(CMtxP m, const Vec *src, Vec *dst)
Definition m_Do_mtx.h:43
void mDoMtx_identity(Mtx m)
Definition m_Do_mtx.h:129
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:31
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:121
void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c)
Definition m_Do_mtx.h:149
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:39
Mtx g_mDoMtx_identity
void mDoMtx_quat(Mtx m, const Quaternion *q)
Definition m_Do_mtx.h:141
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:27
void cMtx_XrotM(Mtx mtx, s16 x)
Definition m_Do_mtx.h:59
void mDoMtx_multVecArray(const Mtx m, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:47
void mDoMtx_scale(Mtx m, f32 x, f32 y, f32 z)
Definition m_Do_mtx.h:137
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:87
void cMtx_concat(const Mtx a, const Mtx b, Mtx ab)
Definition m_Do_mtx.h:35
void cMtx_XrotS(Mtx mtx, s16 x)
Definition m_Do_mtx.h:71
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:133
void cMtx_ZrotS(Mtx mtx, s16 z)
Definition m_Do_mtx.h:79
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])
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:145
void cMtx_inverseTranspose(const Mtx a, Mtx b)
Definition m_Do_mtx.h:107
void mDoMtx_YrotM(Mtx, s16)
Definition m_Do_mtx.cpp:172
MtxP mDoMtx_getIdentity()
Definition m_Do_mtx.h:364
MtxP cMtx_getIdentity()
Definition m_Do_mtx.h:368
void cMtx_multVecArray(const Mtx mtx, const Vec *src, Vec *dst, u32 count)
Definition m_Do_mtx.h:103
void mDoMtx_quatRotAxisRad(Quaternion *q, const Vec *axis, f32 rad)
Definition m_Do_mtx.h:125
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:117
void cMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:99
void cMtx_YrotM(Mtx mtx, s16 y)
Definition m_Do_mtx.h:63
void mDoMtx_multVecZero(CMtxP param_0, Vec *param_1)
Definition m_Do_mtx.h:111
void mDoMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:51
void cMtx_ZrotM(Mtx mtx, s16 z)
Definition m_Do_mtx.h:67
void cMtx_lookAt(Mtx param_0, const Vec *param_1, const Vec *param_2, s16 param_3)
Definition m_Do_mtx.h:83
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
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