sead
Loading...
Searching...
No Matches
seadMatrix.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
#
include
<
math
/
seadMatrixCalcCommon
.
h
>
4
5
namespace
sead
{
6
7
template
<
typename
T
>
8
inline
9
Matrix22
<
T
>::
Matrix22
(
10
T
a00
,
T
a01
,
11
T
a10
,
T
a11
12
)
13
{
14
this
->
m
[0][0] =
a00
;
15
this
->
m
[0][1] =
a01
;
16
17
this
->
m
[1][0] =
a10
;
18
this
->
m
[1][1] =
a11
;
19
}
20
21
template
<
typename
T
>
22
inline
T
23
Matrix22
<
T
>::
operator
()(
s32
i
,
s32
j
)
const
24
{
25
return
this
->
m
[
i
][
j
];
26
}
27
28
template
<
typename
T
>
29
inline
T
&
30
Matrix22
<
T
>::
operator
()(
s32
i
,
s32
j
)
31
{
32
return
this
->
m
[
i
][
j
];
33
}
34
35
template
<
typename
T
>
36
inline
Matrix22
<
T
>&
37
Matrix22
<
T
>::
operator
=(
const
Self
&
n
)
38
{
39
Matrix22CalcCommon
<
T
>::
copy
(*
this
,
n
);
40
return
*
this
;
41
}
42
43
template
<
typename
T
>
44
inline
void
45
Matrix22
<
T
>::
makeIdentity
()
46
{
47
Matrix22CalcCommon
<
T
>::
makeIdentity
(*
this
);
48
}
49
50
template
<
typename
T
>
51
inline
void
52
Matrix22
<
T
>::
makeZero
()
53
{
54
Matrix22CalcCommon
<
T
>::
makeZero
(*
this
);
55
}
56
57
template
<
typename
T
>
58
inline
void
59
Matrix22
<
T
>::
setInverse
(
const
Self
&
n
)
60
{
61
Matrix22CalcCommon
<
T
>::
inverse
(*
this
,
n
);
62
}
63
64
template
<
typename
T
>
65
inline
void
66
Matrix22
<
T
>::
setInverseTranspose
(
const
Self
&
n
)
67
{
68
Matrix22CalcCommon
<
T
>::
inverseTranspose
(*
this
,
n
);
69
}
70
71
template
<
typename
T
>
72
inline
void
73
Matrix22
<
T
>::
setMul
(
const
Self
&
a
,
const
Self
&
b
)
74
{
75
Matrix22CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
76
}
77
78
template
<
typename
T
>
79
inline
void
80
Matrix22
<
T
>::
setTranspose
(
const
Self
&
n
)
81
{
82
Matrix22CalcCommon
<
T
>::
transposeTo
(*
this
,
n
);
83
}
84
85
template
<
typename
T
>
86
inline
void
87
Matrix22
<
T
>::
transpose
()
88
{
89
Matrix22CalcCommon
<
T
>::
transpose
(*
this
);
90
}
91
92
template
<
typename
T
>
93
inline
void
94
Matrix22
<
T
>::
makeRIdx
(
u32
r
)
95
{
96
Matrix22CalcCommon
<
T
>::
makeRIdx
(*
this
,
r
);
97
}
98
99
template
<
typename
T
>
100
inline
101
Matrix33
<
T
>::
Matrix33
(
102
T
a00
,
T
a01
,
T
a02
,
103
T
a10
,
T
a11
,
T
a12
,
104
T
a20
,
T
a21
,
T
a22
105
)
106
{
107
this
->
m
[0][0] =
a00
;
108
this
->
m
[0][1] =
a01
;
109
this
->
m
[0][2] =
a02
;
110
111
112
this
->
m
[1][0] =
a10
;
113
this
->
m
[1][1] =
a11
;
114
this
->
m
[1][2] =
a12
;
115
116
this
->
m
[2][0] =
a20
;
117
this
->
m
[2][1] =
a21
;
118
this
->
m
[2][2] =
a22
;
119
}
120
121
template
<
typename
T
>
122
inline
123
Matrix33
<
T
>::
Matrix33
(
const
Mtx34
&
mtx34
)
124
{
125
Matrix33CalcCommon
<
T
>::
copy
(*
this
,
mtx34
);
126
}
127
128
template
<
typename
T
>
129
inline
T
130
Matrix33
<
T
>::
operator
()(
s32
i
,
s32
j
)
const
131
{
132
return
this
->
m
[
i
][
j
];
133
}
134
135
template
<
typename
T
>
136
inline
T
&
137
Matrix33
<
T
>::
operator
()(
s32
i
,
s32
j
)
138
{
139
return
this
->
m
[
i
][
j
];
140
}
141
142
template
<
typename
T
>
143
inline
Matrix33
<
T
>&
144
Matrix33
<
T
>::
operator
=(
const
Self
&
n
)
145
{
146
Matrix33CalcCommon
<
T
>::
copy
(*
this
,
n
);
147
return
*
this
;
148
}
149
150
template
<
typename
T
>
151
inline
void
152
Matrix33
<
T
>::
makeIdentity
()
153
{
154
Matrix33CalcCommon
<
T
>::
makeIdentity
(*
this
);
155
}
156
157
template
<
typename
T
>
158
inline
void
159
Matrix33
<
T
>::
makeZero
()
160
{
161
Matrix33CalcCommon
<
T
>::
makeZero
(*
this
);
162
}
163
164
template
<
typename
T
>
165
inline
void
166
Matrix33
<
T
>::
setInverse
(
const
Self
&
n
)
167
{
168
Matrix33CalcCommon
<
T
>::
inverse
(*
this
,
n
);
169
}
170
171
template
<
typename
T
>
172
inline
void
173
Matrix33
<
T
>::
setInverseTranspose
(
const
Self
&
n
)
174
{
175
Matrix33CalcCommon
<
T
>::
inverseTranspose
(*
this
,
n
);
176
}
177
178
template
<
typename
T
>
179
inline
void
180
Matrix33
<
T
>::
setMul
(
const
Self
&
a
,
const
Self
&
b
)
181
{
182
Matrix33CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
183
}
184
185
template
<
typename
T
>
186
inline
void
187
Matrix33
<
T
>::
setMul
(
const
Mtx34
&
a
,
const
Self
&
b
)
188
{
189
Matrix33CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
190
}
191
192
template
<
typename
T
>
193
inline
void
194
Matrix33
<
T
>::
setMul
(
const
Self
&
a
,
const
Mtx34
&
b
)
195
{
196
Matrix33CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
197
}
198
199
template
<
typename
T
>
200
inline
void
201
Matrix33
<
T
>::
setTranspose
(
const
Self
&
n
)
202
{
203
Matrix33CalcCommon
<
T
>::
transposeTo
(*
this
,
n
);
204
}
205
206
template
<
typename
T
>
207
inline
void
208
Matrix33
<
T
>::
transpose
()
209
{
210
Matrix33CalcCommon
<
T
>::
transpose
(*
this
);
211
}
212
213
template
<
typename
T
>
214
inline
void
215
Matrix33
<
T
>::
makeQ
(
const
Quat
&
q
)
216
{
217
Matrix33CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
218
}
219
220
template
<
typename
T
>
221
inline
void
222
Matrix33
<
T
>::
makeR
(
const
Vec3
&
r
)
223
{
224
Matrix33CalcCommon
<
T
>::
makeR
(*
this
,
r
);
225
}
226
227
template
<
typename
T
>
228
inline
void
229
Matrix33
<
T
>::
makeRIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
230
{
231
Matrix33CalcCommon
<
T
>::
makeRIdx
(*
this
,
xr
,
yr
,
zr
);
232
}
233
234
template
<
typename
T
>
235
inline
void
236
Matrix33
<
T
>::
makeRzxyIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
237
{
238
Matrix33CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
xr
,
yr
,
zr
);
239
}
240
241
template
<
typename
T
>
242
inline
void
243
Matrix33
<
T
>::
makeS
(
const
Vec3
&
s
)
244
{
245
Matrix33CalcCommon
<
T
>::
makeS
(*
this
,
s
);
246
}
247
248
template
<
typename
T
>
249
inline
void
250
Matrix33
<
T
>::
makeS
(
T
x
,
T
y
,
T
z
)
251
{
252
Vec3 s(x, y, z);
253
Matrix33CalcCommon
<
T
>::
makeS
(*
this
,
s
);
254
}
255
256
template
<
typename
T
>
257
inline
void
258
Matrix33
<
T
>::
makeSR
(
const
Vec3
&
s
,
const
Vec3
&
r
)
259
{
260
Matrix33CalcCommon
<
T
>::
makeSR
(*
this
,
s
,
r
);
261
}
262
263
template
<
typename
T
>
264
inline
void
265
Matrix33
<
T
>::
makeSRIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
266
{
267
Matrix33CalcCommon
<
T
>::
makeSRIdx
(*
this
,
s
,
r
);
268
}
269
270
template
<
typename
T
>
271
inline
void
272
Matrix33
<
T
>::
makeSRzxyIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
273
{
274
Matrix33CalcCommon
<
T
>::
makeSRzxyIdx
(*
this
,
s
,
r
);
275
}
276
277
template
<
typename
T
>
278
inline
void
279
Matrix33
<
T
>::
toQuat
(
Quat
&
q
)
const
280
{
281
Matrix33CalcCommon
<
T
>::
toQuat
(
q
, *
this
);
282
}
283
284
template
<
typename
T
>
285
inline
286
Matrix34
<
T
>::
Matrix34
(
287
T
a00
,
T
a01
,
T
a02
,
T
a03
,
288
T
a10
,
T
a11
,
T
a12
,
T
a13
,
289
T
a20
,
T
a21
,
T
a22
,
T
a23
290
)
291
{
292
this
->
m
[0][0] =
a00
;
293
this
->
m
[0][1] =
a01
;
294
this
->
m
[0][2] =
a02
;
295
this
->
m
[0][3] =
a03
;
296
297
this
->
m
[1][0] =
a10
;
298
this
->
m
[1][1] =
a11
;
299
this
->
m
[1][2] =
a12
;
300
this
->
m
[1][3] =
a13
;
301
302
this
->
m
[2][0] =
a20
;
303
this
->
m
[2][1] =
a21
;
304
this
->
m
[2][2] =
a22
;
305
this
->
m
[2][3] =
a23
;
306
}
307
308
template
<
typename
T
>
309
inline
310
Matrix34
<
T
>::
Matrix34
(
const
Mtx33
&
mtx33
,
const
Vec3
&
t
)
311
{
312
Matrix34CalcCommon
<
T
>::
copy
(*
this
,
mtx33
,
t
);
313
}
314
315
template
<
typename
T
>
316
inline
317
Matrix34
<
T
>::
Matrix34
(
const
Mtx44
&
mtx44
)
318
{
319
Matrix34CalcCommon
<
T
>::
copy
(*
this
,
mtx44
);
320
}
321
322
template
<
typename
T
>
323
inline
T
324
Matrix34
<
T
>::
operator
()(
s32
i
,
s32
j
)
const
325
{
326
return
this
->
m
[
i
][
j
];
327
}
328
329
template
<
typename
T
>
330
inline
T
&
331
Matrix34
<
T
>::
operator
()(
s32
i
,
s32
j
)
332
{
333
return
this
->
m
[
i
][
j
];
334
}
335
336
template
<
typename
T
>
337
inline
Matrix34
<
T
>&
338
Matrix34
<
T
>::
operator
=(
const
Self
&
n
)
339
{
340
Matrix34CalcCommon
<
T
>::
copy
(*
this
,
n
);
341
return
*
this
;
342
}
343
344
template
<
typename
T
>
345
inline
void
346
Matrix34
<
T
>::
makeIdentity
()
347
{
348
Matrix34CalcCommon
<
T
>::
makeIdentity
(*
this
);
349
}
350
351
template
<
typename
T
>
352
inline
void
353
Matrix34
<
T
>::
makeZero
()
354
{
355
Matrix34CalcCommon
<
T
>::
makeZero
(*
this
);
356
}
357
358
template
<
typename
T
>
359
inline
void
360
Matrix34
<
T
>::
setInverse
(
const
Self
&
n
)
361
{
362
Matrix34CalcCommon
<
T
>::
inverse
(*
this
,
n
);
363
}
364
365
template
<
typename
T
>
366
inline
void
367
Matrix34
<
T
>::
setInverse33
(
const
Self
&
n
)
368
{
369
Matrix34CalcCommon
<
T
>::
inverse33
(*
this
,
n
);
370
}
371
372
template
<
typename
T
>
373
inline
void
374
Matrix34
<
T
>::
setInverseTranspose
(
const
Self
&
n
)
375
{
376
Matrix34CalcCommon
<
T
>::
inverseTranspose
(*
this
,
n
);
377
}
378
379
template
<
typename
T
>
380
inline
void
381
Matrix34
<
T
>::
setMul
(
const
Self
&
a
,
const
Self
&
b
)
382
{
383
Matrix34CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
384
}
385
386
template
<
typename
T
>
387
inline
void
388
Matrix34
<
T
>::
setMul
(
const
Mtx33
&
a
,
const
Self
&
b
)
389
{
390
Matrix34CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
391
}
392
393
template
<
typename
T
>
394
inline
void
395
Matrix34
<
T
>::
setTranspose
(
const
Self
&
n
)
396
{
397
Matrix34CalcCommon
<
T
>::
transposeTo
(*
this
,
n
);
398
}
399
400
template
<
typename
T
>
401
inline
void
402
Matrix34
<
T
>::
transpose
()
403
{
404
Matrix34CalcCommon
<
T
>::
transpose
(*
this
);
405
}
406
407
template
<
typename
T
>
408
inline
void
409
Matrix34
<
T
>::
makeQ
(
const
Quat
&
q
)
410
{
411
Matrix34CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
412
}
413
414
template
<
typename
T
>
415
inline
void
416
Matrix34
<
T
>::
makeQ
(
T
w
,
T
x
,
T
y
,
T
z
)
417
{
418
Quat q(w, x, y, z);
419
Matrix34CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
420
}
421
422
template
<
typename
T
>
423
inline
void
424
Matrix34
<
T
>::
makeQT
(
const
Quat
&
q
,
const
Vec3
&
t
)
425
{
426
Matrix34CalcCommon
<
T
>::
makeQT
(*
this
,
q
,
t
);
427
}
428
429
template
<
typename
T
>
430
inline
void
431
Matrix34
<
T
>::
makeR
(
const
Vec3
&
r
)
432
{
433
Matrix34CalcCommon
<
T
>::
makeR
(*
this
,
r
);
434
}
435
436
template
<
typename
T
>
437
inline
void
438
Matrix34
<
T
>::
makeRIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
439
{
440
Matrix34CalcCommon
<
T
>::
makeRIdx
(*
this
,
xr
,
yr
,
zr
);
441
}
442
443
template
<
typename
T
>
444
inline
void
445
Matrix34
<
T
>::
makeRT
(
const
Vec3
&
r
,
const
Vec3
&
t
)
446
{
447
Matrix34CalcCommon
<
T
>::
makeRT
(*
this
,
r
,
t
);
448
}
449
450
template
<
typename
T
>
451
inline
void
452
Matrix34
<
T
>::
makeRTIdx
(
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
453
{
454
Matrix34CalcCommon
<
T
>::
makeRTIdx
(*
this
,
r
,
t
);
455
}
456
457
template
<
typename
T
>
458
inline
void
459
Matrix34
<
T
>::
makeRzxyIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
460
{
461
Matrix34CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
xr
,
yr
,
zr
);
462
}
463
464
template
<
typename
T
>
465
inline
void
466
Matrix34
<
T
>::
makeRzxyIdx
(
const
Vector3
<
u32
>&
r
)
467
{
468
Matrix34CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
r
.
x
,
r
.
y
,
r
.
z
);
469
}
470
471
template
<
typename
T
>
472
inline
void
473
Matrix34
<
T
>::
makeRzxyTIdx
(
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
474
{
475
Matrix34CalcCommon
<
T
>::
makeRzxyTIdx
(*
this
,
r
,
t
);
476
}
477
478
template
<
typename
T
>
479
inline
void
480
Matrix34
<
T
>::
makeS
(
const
Vec3
&
s
)
481
{
482
Matrix34CalcCommon
<
T
>::
makeS
(*
this
,
s
);
483
}
484
485
template
<
typename
T
>
486
inline
void
487
Matrix34
<
T
>::
makeS
(
T
x
,
T
y
,
T
z
)
488
{
489
Vec3 s(x, y, z);
490
Matrix34CalcCommon
<
T
>::
makeS
(*
this
,
s
);
491
}
492
493
template
<
typename
T
>
494
inline
void
495
Matrix34
<
T
>::
makeSQ
(
const
Vec3
&
s
,
const
Quat
&
q
)
496
{
497
Matrix34CalcCommon
<
T
>::
makeSQ
(*
this
,
s
,
q
);
498
}
499
500
template
<
typename
T
>
501
inline
void
502
Matrix34
<
T
>::
makeSQT
(
const
Vec3
&
s
,
const
Quat
&
q
,
const
Vec3
&
t
)
503
{
504
Matrix34CalcCommon
<
T
>::
makeSQT
(*
this
,
s
,
q
,
t
);
505
}
506
507
template
<
typename
T
>
508
inline
void
509
Matrix34
<
T
>::
makeSR
(
const
Vec3
&
s
,
const
Vec3
&
r
)
510
{
511
Matrix34CalcCommon
<
T
>::
makeSR
(*
this
,
s
,
r
);
512
}
513
514
template
<
typename
T
>
515
inline
void
516
Matrix34
<
T
>::
makeSRIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
517
{
518
Matrix34CalcCommon
<
T
>::
makeSRIdx
(*
this
,
s
,
r
);
519
}
520
521
template
<
typename
T
>
522
inline
void
523
Matrix34
<
T
>::
makeSRT
(
const
Vec3
&
s
,
const
Vec3
&
r
,
const
Vec3
&
t
)
524
{
525
Matrix34CalcCommon
<
T
>::
makeSRT
(*
this
,
s
,
r
,
t
);
526
}
527
528
template
<
typename
T
>
529
inline
void
530
Matrix34
<
T
>::
makeSRTIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
531
{
532
Matrix34CalcCommon
<
T
>::
makeSRTIdx
(*
this
,
s
,
r
,
t
);
533
}
534
535
template
<
typename
T
>
536
inline
void
537
Matrix34
<
T
>::
makeSRzxyIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
538
{
539
Matrix34CalcCommon
<
T
>::
makeSRzxyIdx
(*
this
,
s
,
r
);
540
}
541
542
template
<
typename
T
>
543
inline
void
544
Matrix34
<
T
>::
makeSRzxyTIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
545
{
546
Matrix34CalcCommon
<
T
>::
makeSRzxyTIdx
(*
this
,
s
,
r
,
t
);
547
}
548
549
template
<
typename
T
>
550
inline
void
551
Matrix34
<
T
>::
makeST
(
const
Vec3
&
s
,
const
Vec3
&
t
)
552
{
553
Matrix34CalcCommon
<
T
>::
makeST
(*
this
,
s
,
t
);
554
}
555
556
template
<
typename
T
>
557
inline
void
558
Matrix34
<
T
>::
makeT
(
const
Vec3
&
t
)
559
{
560
Matrix34CalcCommon
<
T
>::
makeT
(*
this
,
t
);
561
}
562
563
template
<
typename
T
>
564
inline
void
565
Matrix34
<
T
>::
makeT
(
T
x
,
T
y
,
T
z
)
566
{
567
Vec3 t(x, y, z);
568
Matrix34CalcCommon
<
T
>::
makeT
(*
this
,
t
);
569
}
570
571
template
<
typename
T
>
572
inline
void
573
Matrix34
<
T
>::
toQuat
(
Quat
&
q
)
const
574
{
575
Matrix34CalcCommon
<
T
>::
toQuat
(
q
, *
this
);
576
}
577
578
template
<
typename
T
>
579
inline
void
580
Matrix34
<
T
>::
multScaleLocal
(
const
Vec3
&
s
)
581
{
582
Matrix34CalcCommon
<
T
>::
multScaleLocal
(*
this
, *
this
,
s
);
583
}
584
585
template
<
typename
T
>
586
inline
void
587
Matrix34
<
T
>::
setMultScaleLocal
(
const
Self
&
n
,
const
Vec3
&
s
)
588
{
589
Matrix34CalcCommon
<
T
>::
multScaleLocal
(*
this
,
n
,
s
);
590
}
591
592
template
<
typename
T
>
593
inline
void
594
Matrix34
<
T
>::
multTranslationLocal
(
const
Vec3
&
t
)
595
{
596
Matrix34CalcCommon
<
T
>::
multTranslationLocal
(*
this
, *
this
,
t
);
597
}
598
599
template
<
typename
T
>
600
inline
void
601
Matrix34
<
T
>::
setMultTranslationLocal
(
const
Self
&
n
,
const
Vec3
&
t
)
602
{
603
Matrix34CalcCommon
<
T
>::
multTranslationLocal
(*
this
,
n
,
t
);
604
}
605
606
template
<
typename
T
>
607
inline
void
608
Matrix34
<
T
>::
multScaleWorld
(
const
Vec3
&
s
)
609
{
610
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
s
, *
this
);
611
}
612
613
template
<
typename
T
>
614
inline
void
615
Matrix34
<
T
>::
multScaleWorld
(
T
x
,
T
y
,
T
z
)
616
{
617
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
Vec3
(
x
,
y
,
z
), *
this
);
618
}
619
620
#
ifdef
cafe
621
622
template
<>
623
inline
void
624
Matrix34
<
f32
>::
multScaleWorld
(
f32
x
,
f32
y
,
f32
z
)
625
{
626
ASM_MTXScaleApply
(
m
,
m
,
x
,
y
,
z
);
627
}
628
629
#
endif
// cafe
630
631
template
<
typename
T
>
632
inline
void
633
Matrix34
<
T
>::
setMultScaleWorld
(
const
Vec3
&
s
,
const
Self
&
n
)
634
{
635
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
s
,
n
);
636
}
637
638
template
<
typename
T
>
639
inline
void
640
Matrix34
<
T
>::
setMultScaleWorld
(
T
x
,
T
y
,
T
z
,
const
Self
&
n
)
641
{
642
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
Vec3
(
x
,
y
,
z
),
n
);
643
}
644
645
#
ifdef
cafe
646
647
template
<>
648
inline
void
649
Matrix34
<
f32
>::
setMultScaleWorld
(
f32
x
,
f32
y
,
f32
z
,
const
Self
&
n
)
650
{
651
ASM_MTXScaleApply
(
const_cast
<
f32
(*)[4]>(
n
.
m
),
m
,
x
,
y
,
z
);
652
}
653
654
#
endif
// cafe
655
656
template
<
typename
T
>
657
inline
void
658
Matrix34
<
T
>::
multTranslationWorld
(
const
Vec3
&
t
)
659
{
660
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
t
, *
this
);
661
}
662
663
template
<
typename
T
>
664
inline
void
665
Matrix34
<
T
>::
multTranslationWorld
(
T
x
,
T
y
,
T
z
)
666
{
667
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
Vec3
(
x
,
y
,
z
), *
this
);
668
}
669
670
#
ifdef
cafe
671
672
template
<>
673
inline
void
674
Matrix34
<
f32
>::
multTranslationWorld
(
f32
x
,
f32
y
,
f32
z
)
675
{
676
ASM_MTXTransApply
(
m
,
m
,
x
,
y
,
z
);
677
}
678
679
#
endif
// cafe
680
681
template
<
typename
T
>
682
inline
void
683
Matrix34
<
T
>::
setMultTranslationWorld
(
const
Vec3
&
t
,
const
Self
&
n
)
684
{
685
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
t
,
n
);
686
}
687
688
template
<
typename
T
>
689
inline
void
690
Matrix34
<
T
>::
setMultTranslationWorld
(
T
x
,
T
y
,
T
z
,
const
Self
&
n
)
691
{
692
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
Vec3
(
x
,
y
,
z
),
n
);
693
}
694
695
#
ifdef
cafe
696
697
template
<>
698
inline
void
699
Matrix34
<
f32
>::
setMultTranslationWorld
(
f32
x
,
f32
y
,
f32
z
,
const
Self
&
n
)
700
{
701
ASM_MTXTransApply
(
const_cast
<
f32
(*)[4]>(
n
.
m
),
m
,
x
,
y
,
z
);
702
}
703
704
#
endif
// cafe
705
706
template
<
typename
T
>
707
inline
void
708
Matrix34
<
T
>::
getBase
(
Vec3
&
o
,
s32
axis
)
const
709
{
710
Matrix34CalcCommon
<
T
>::
getBase
(
o
, *
this
,
axis
);
711
}
712
713
template
<
typename
T
>
714
inline
Matrix34
<
T
>::
Vec3
715
Matrix34
<
T
>::
getBase
(
s32
axis
)
const
716
{
717
Vec3 o;
718
Matrix34CalcCommon
<
T
>::
getBase
(
o
, *
this
,
axis
);
719
return
o
;
720
}
721
722
template
<
typename
T
>
723
inline
void
724
Matrix34
<
T
>::
getRow
(
Vec4
&
o
,
s32
row
)
const
725
{
726
Matrix34CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
727
}
728
729
template
<
typename
T
>
730
inline
Matrix34
<
T
>::
Vec4
731
Matrix34
<
T
>::
getRow
(
s32
row
)
const
732
{
733
Vec4 o;
734
Matrix34CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
735
return
o
;
736
}
737
738
template
<
typename
T
>
739
inline
void
740
Matrix34
<
T
>::
getTranslation
(
Vec3
&
o
)
const
741
{
742
Matrix34CalcCommon
<
T
>::
getTranslation
(
o
, *
this
);
743
}
744
745
template
<
typename
T
>
746
inline
Matrix34
<
T
>::
Vec3
747
Matrix34
<
T
>::
getTranslation
()
const
748
{
749
Vec3 o;
750
Matrix34CalcCommon
<
T
>::
getTranslation
(
o
, *
this
);
751
return
o
;
752
}
753
754
template
<
typename
T
>
755
inline
void
756
Matrix34
<
T
>::
scaleAllElements
(
T
s
)
757
{
758
Matrix34CalcCommon
<
T
>::
scaleAllElements
(*
this
,
s
);
759
}
760
761
template
<
typename
T
>
762
inline
void
763
Matrix34
<
T
>::
scaleBases
(
T
s
)
764
{
765
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
s
,
s
,
s
);
766
}
767
768
template
<
typename
T
>
769
inline
void
770
Matrix34
<
T
>::
scaleBases
(
T
sx
,
T
sy
,
T
sz
)
771
{
772
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
sx
,
sy
,
sz
);
773
}
774
775
template
<
typename
T
>
776
inline
void
777
Matrix34
<
T
>::
scaleBases
(
const
Vec3
&
s
)
778
{
779
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
s
.
x
,
s
.
y
,
s
.
z
);
780
}
781
782
template
<
typename
T
>
783
inline
void
784
Matrix34
<
T
>::
setBase
(
s32
axis
,
const
Vec3
&
v
)
785
{
786
Matrix34CalcCommon
<
T
>::
setBase
(*
this
,
axis
,
v
);
787
}
788
789
template
<
typename
T
>
790
inline
void
791
Matrix34
<
T
>::
setRow
(
s32
row
,
const
Vec4
&
v
)
792
{
793
Matrix34CalcCommon
<
T
>::
setRow
(*
this
,
v
,
row
);
794
}
795
796
template
<
typename
T
>
797
inline
void
798
Matrix34
<
T
>::
setTranslation
(
const
Vec3
&
t
)
799
{
800
Matrix34CalcCommon
<
T
>::
setTranslation
(*
this
,
t
);
801
}
802
803
template
<
typename
T
>
804
inline
void
805
Matrix34
<
T
>::
setTranslation
(
T
x
,
T
y
,
T
z
)
806
{
807
Vec3 t(x, y, z);
808
Matrix34CalcCommon
<
T
>::
setTranslation
(*
this
,
t
);
809
}
810
811
template
<
typename
T
>
812
inline
813
Matrix44
<
T
>::
Matrix44
(
814
T
a00
,
T
a01
,
T
a02
,
T
a03
,
815
T
a10
,
T
a11
,
T
a12
,
T
a13
,
816
T
a20
,
T
a21
,
T
a22
,
T
a23
,
817
T
a30
,
T
a31
,
T
a32
,
T
a33
818
)
819
{
820
this
->
m
[0][0] =
a00
;
821
this
->
m
[0][1] =
a01
;
822
this
->
m
[0][2] =
a02
;
823
this
->
m
[0][3] =
a03
;
824
825
this
->
m
[1][0] =
a10
;
826
this
->
m
[1][1] =
a11
;
827
this
->
m
[1][2] =
a12
;
828
this
->
m
[1][3] =
a13
;
829
830
this
->
m
[2][0] =
a20
;
831
this
->
m
[2][1] =
a21
;
832
this
->
m
[2][2] =
a22
;
833
this
->
m
[2][3] =
a23
;
834
835
this
->
m
[3][0] =
a30
;
836
this
->
m
[3][1] =
a31
;
837
this
->
m
[3][2] =
a32
;
838
this
->
m
[3][3] =
a33
;
839
}
840
841
template
<
typename
T
>
842
inline
843
Matrix44
<
T
>::
Matrix44
(
const
Mtx33
&
mtx33
,
const
Vec3
&
t
,
const
Vec4
&
vw
)
844
{
845
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
mtx33
,
t
,
vw
);
846
}
847
848
template
<
typename
T
>
849
inline
850
Matrix44
<
T
>::
Matrix44
(
const
Mtx34
&
mtx34
,
const
Vec4
&
vw
)
851
{
852
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
mtx34
,
vw
);
853
}
854
855
template
<
typename
T
>
856
inline
T
857
Matrix44
<
T
>::
operator
()(
s32
i
,
s32
j
)
const
858
{
859
return
this
->
m
[
i
][
j
];
860
}
861
862
template
<
typename
T
>
863
inline
T
&
864
Matrix44
<
T
>::
operator
()(
s32
i
,
s32
j
)
865
{
866
return
this
->
m
[
i
][
j
];
867
}
868
869
template
<
typename
T
>
870
inline
Matrix44
<
T
>&
871
Matrix44
<
T
>::
operator
=(
const
Self
&
n
)
872
{
873
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
n
);
874
return
*
this
;
875
}
876
877
template
<
typename
T
>
878
inline
void
879
Matrix44
<
T
>::
makeIdentity
()
880
{
881
Matrix44CalcCommon
<
T
>::
makeIdentity
(*
this
);
882
}
883
884
template
<
typename
T
>
885
inline
void
886
Matrix44
<
T
>::
makeZero
()
887
{
888
Matrix44CalcCommon
<
T
>::
makeZero
();
889
}
890
891
template
<
typename
T
>
892
inline
void
893
Matrix44
<
T
>::
setInverse
(
const
Self
&
n
)
894
{
895
Matrix44CalcCommon
<
T
>::
inverse
(*
this
,
n
);
896
}
897
898
template
<
typename
T
>
899
inline
void
900
Matrix44
<
T
>::
setMul
(
const
Self
&
a
,
const
Self
&
b
)
901
{
902
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
903
}
904
905
template
<
typename
T
>
906
inline
void
907
Matrix44
<
T
>::
setMul
(
const
Mtx34
&
a
,
const
Self
&
b
)
908
{
909
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
910
}
911
912
template
<
typename
T
>
913
inline
void
914
Matrix44
<
T
>::
setMul
(
const
Self
&
a
,
const
Mtx34
&
b
)
915
{
916
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
917
}
918
919
template
<
typename
T
>
920
inline
void
921
Matrix44
<
T
>::
setTranspose
(
const
Self
&
n
)
922
{
923
Matrix44CalcCommon
<
T
>::
transposeTo
(*
this
,
n
);
924
}
925
926
template
<
typename
T
>
927
inline
void
928
Matrix44
<
T
>::
transpose
()
929
{
930
Matrix44CalcCommon
<
T
>::
transpose
(*
this
);
931
}
932
933
template
<
typename
T
>
934
inline
void
935
Matrix44
<
T
>::
makeQ
(
const
Quat
&
q
)
936
{
937
Matrix44CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
938
}
939
940
template
<
typename
T
>
941
inline
void
942
Matrix44
<
T
>::
makeR
(
const
Vec3
&
r
)
943
{
944
Matrix44CalcCommon
<
T
>::
makeR
(*
this
,
r
);
945
}
946
947
template
<
typename
T
>
948
inline
void
949
Matrix44
<
T
>::
makeRIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
950
{
951
Matrix44CalcCommon
<
T
>::
makeRIdx
(*
this
,
xr
,
yr
,
zr
);
952
}
953
954
template
<
typename
T
>
955
inline
void
956
Matrix44
<
T
>::
makeRzxyIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
957
{
958
Matrix44CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
xr
,
yr
,
zr
);
959
}
960
961
template
<
typename
T
>
962
inline
void
963
Matrix44
<
T
>::
toQuat
(
Quat
&
q
)
const
964
{
965
Matrix44CalcCommon
<
T
>::
toQuat
(
q
, *
this
);
966
}
967
968
template
<
typename
T
>
969
inline
void
970
Matrix44
<
T
>::
getCol
(
Vec4
&
o
,
s32
axis
)
const
971
{
972
Matrix44CalcCommon
<
T
>::
getCol
(
o
, *
this
,
axis
);
973
}
974
975
template
<
typename
T
>
976
inline
Matrix44
<
T
>::
Vec4
977
Matrix44
<
T
>::
getCol
(
s32
axis
)
const
978
{
979
Vec4 o;
980
Matrix44CalcCommon
<
T
>::
getCol
(
o
, *
this
,
axis
);
981
return
o
;
982
}
983
984
template
<
typename
T
>
985
inline
void
986
Matrix44
<
T
>::
getRow
(
Vec4
&
o
,
s32
row
)
const
987
{
988
Matrix44CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
989
}
990
991
template
<
typename
T
>
992
inline
Matrix44
<
T
>::
Vec4
993
Matrix44
<
T
>::
getRow
(
s32
row
)
const
994
{
995
Vec4 o;
996
Matrix44CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
997
return
o
;
998
}
999
1000
template
<
typename
T
>
1001
inline
void
1002
Matrix44
<
T
>::
scaleAllElements
(
T
s
)
1003
{
1004
Matrix44CalcCommon
<
T
>::
scaleAllElements
(*
this
,
s
);
1005
}
1006
1007
template
<
typename
T
>
1008
inline
void
1009
Matrix44
<
T
>::
scaleBases
(
T
sx
,
T
sy
,
T
sz
,
T
sw
)
1010
{
1011
Matrix44CalcCommon
<
T
>::
scaleBases
(*
this
,
sx
,
sy
,
sz
,
sw
);
1012
}
1013
1014
template
<
typename
T
>
1015
inline
void
1016
Matrix44
<
T
>::
setCol
(
s32
axis
,
const
Vec4
&
v
)
1017
{
1018
Matrix44CalcCommon
<
T
>::
setCol
(*
this
,
axis
,
v
);
1019
}
1020
1021
template
<
typename
T
>
1022
inline
void
1023
Matrix44
<
T
>::
setRow
(
s32
row
,
const
Vec4
&
v
)
1024
{
1025
Matrix44CalcCommon
<
T
>::
setRow
(*
this
,
v
,
row
);
1026
}
1027
1028
}
// namespace sead
sead
Definition
seadAssert.h:44
engine
library
include
math
seadMatrix.hpp
Generated by
1.14.0