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
>::
fromQuat
(
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
>::
fromQuat
(
const
Quat
&
q
)
410
{
411
Matrix34CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
412
}
413
414
template
<
typename
T
>
415
inline
void
416
Matrix34
<
T
>::
makeR
(
const
Vec3
&
r
)
417
{
418
Matrix34CalcCommon
<
T
>::
makeR
(*
this
,
r
);
419
}
420
421
template
<
typename
T
>
422
inline
void
423
Matrix34
<
T
>::
makeRIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
424
{
425
Matrix34CalcCommon
<
T
>::
makeRIdx
(*
this
,
xr
,
yr
,
zr
);
426
}
427
428
template
<
typename
T
>
429
inline
void
430
Matrix34
<
T
>::
makeRT
(
const
Vec3
&
r
,
const
Vec3
&
t
)
431
{
432
Matrix34CalcCommon
<
T
>::
makeRT
(*
this
,
r
,
t
);
433
}
434
435
template
<
typename
T
>
436
inline
void
437
Matrix34
<
T
>::
makeRTIdx
(
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
438
{
439
Matrix34CalcCommon
<
T
>::
makeRTIdx
(*
this
,
r
,
t
);
440
}
441
442
template
<
typename
T
>
443
inline
void
444
Matrix34
<
T
>::
makeRzxyIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
445
{
446
Matrix34CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
xr
,
yr
,
zr
);
447
}
448
449
template
<
typename
T
>
450
inline
void
451
Matrix34
<
T
>::
makeRzxyIdx
(
const
Vector3
<
u32
>&
r
)
452
{
453
Matrix34CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
r
.
x
,
r
.
y
,
r
.
z
);
454
}
455
456
template
<
typename
T
>
457
inline
void
458
Matrix34
<
T
>::
makeRzxyTIdx
(
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
459
{
460
Matrix34CalcCommon
<
T
>::
makeRzxyTIdx
(*
this
,
r
,
t
);
461
}
462
463
template
<
typename
T
>
464
inline
void
465
Matrix34
<
T
>::
makeS
(
const
Vec3
&
s
)
466
{
467
Matrix34CalcCommon
<
T
>::
makeS
(*
this
,
s
);
468
}
469
470
template
<
typename
T
>
471
inline
void
472
Matrix34
<
T
>::
makeS
(
T
x
,
T
y
,
T
z
)
473
{
474
Vec3 s(x, y, z);
475
Matrix34CalcCommon
<
T
>::
makeS
(*
this
,
s
);
476
}
477
478
template
<
typename
T
>
479
inline
void
480
Matrix34
<
T
>::
makeSR
(
const
Vec3
&
s
,
const
Vec3
&
r
)
481
{
482
Matrix34CalcCommon
<
T
>::
makeSR
(*
this
,
s
,
r
);
483
}
484
485
template
<
typename
T
>
486
inline
void
487
Matrix34
<
T
>::
makeSRIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
488
{
489
Matrix34CalcCommon
<
T
>::
makeSRIdx
(*
this
,
s
,
r
);
490
}
491
492
template
<
typename
T
>
493
inline
void
494
Matrix34
<
T
>::
makeSRT
(
const
Vec3
&
s
,
const
Vec3
&
r
,
const
Vec3
&
t
)
495
{
496
Matrix34CalcCommon
<
T
>::
makeSRT
(*
this
,
s
,
r
,
t
);
497
}
498
499
template
<
typename
T
>
500
inline
void
501
Matrix34
<
T
>::
makeSRTIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
502
{
503
Matrix34CalcCommon
<
T
>::
makeSRTIdx
(*
this
,
s
,
r
,
t
);
504
}
505
506
template
<
typename
T
>
507
inline
void
508
Matrix34
<
T
>::
makeSRzxyIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
)
509
{
510
Matrix34CalcCommon
<
T
>::
makeSRzxyIdx
(*
this
,
s
,
r
);
511
}
512
513
template
<
typename
T
>
514
inline
void
515
Matrix34
<
T
>::
makeSRzxyTIdx
(
const
Vec3
&
s
,
const
Vector3
<
u32
>&
r
,
const
Vec3
&
t
)
516
{
517
Matrix34CalcCommon
<
T
>::
makeSRzxyTIdx
(*
this
,
s
,
r
,
t
);
518
}
519
520
template
<
typename
T
>
521
inline
void
522
Matrix34
<
T
>::
makeST
(
const
Vec3
&
s
,
const
Vec3
&
t
)
523
{
524
Matrix34CalcCommon
<
T
>::
makeST
(*
this
,
s
,
t
);
525
}
526
527
template
<
typename
T
>
528
inline
void
529
Matrix34
<
T
>::
makeT
(
const
Vec3
&
t
)
530
{
531
Matrix34CalcCommon
<
T
>::
makeT
(*
this
,
t
);
532
}
533
534
template
<
typename
T
>
535
inline
void
536
Matrix34
<
T
>::
makeT
(
T
x
,
T
y
,
T
z
)
537
{
538
Vec3 t(x, y, z);
539
Matrix34CalcCommon
<
T
>::
makeT
(*
this
,
t
);
540
}
541
542
template
<
typename
T
>
543
inline
void
544
Matrix34
<
T
>::
toQuat
(
Quat
&
q
)
const
545
{
546
Matrix34CalcCommon
<
T
>::
toQuat
(
q
, *
this
);
547
}
548
549
template
<
typename
T
>
550
inline
void
551
Matrix34
<
T
>::
multScaleLocal
(
const
Vec3
&
s
)
552
{
553
Matrix34CalcCommon
<
T
>::
multScaleLocal
(*
this
, *
this
,
s
);
554
}
555
556
template
<
typename
T
>
557
inline
void
558
Matrix34
<
T
>::
setMultScaleLocal
(
const
Self
&
n
,
const
Vec3
&
s
)
559
{
560
Matrix34CalcCommon
<
T
>::
multScaleLocal
(*
this
,
n
,
s
);
561
}
562
563
template
<
typename
T
>
564
inline
void
565
Matrix34
<
T
>::
multTranslationLocal
(
const
Vec3
&
t
)
566
{
567
Matrix34CalcCommon
<
T
>::
multTranslationLocal
(*
this
, *
this
,
t
);
568
}
569
570
template
<
typename
T
>
571
inline
void
572
Matrix34
<
T
>::
setMultTranslationLocal
(
const
Self
&
n
,
const
Vec3
&
t
)
573
{
574
Matrix34CalcCommon
<
T
>::
multTranslationLocal
(*
this
,
n
,
t
);
575
}
576
577
template
<
typename
T
>
578
inline
void
579
Matrix34
<
T
>::
multScaleWorld
(
const
Vec3
&
s
)
580
{
581
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
s
, *
this
);
582
}
583
584
template
<
typename
T
>
585
inline
void
586
Matrix34
<
T
>::
multScaleWorld
(
T
x
,
T
y
,
T
z
)
587
{
588
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
Vec3
(
x
,
y
,
z
), *
this
);
589
}
590
591
#
ifdef
cafe
592
593
template
<>
594
inline
void
595
Matrix34
<
f32
>::
multScaleWorld
(
f32
x
,
f32
y
,
f32
z
)
596
{
597
ASM_MTXScaleApply
(
m
,
m
,
x
,
y
,
z
);
598
}
599
600
#
endif
// cafe
601
602
template
<
typename
T
>
603
inline
void
604
Matrix34
<
T
>::
setMultScaleWorld
(
const
Vec3
&
s
,
const
Self
&
n
)
605
{
606
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
s
,
n
);
607
}
608
609
template
<
typename
T
>
610
inline
void
611
Matrix34
<
T
>::
setMultScaleWorld
(
T
x
,
T
y
,
T
z
,
const
Self
&
n
)
612
{
613
Matrix34CalcCommon
<
T
>::
multScaleWorld
(*
this
,
Vec3
(
x
,
y
,
z
),
n
);
614
}
615
616
#
ifdef
cafe
617
618
template
<>
619
inline
void
620
Matrix34
<
f32
>::
setMultScaleWorld
(
f32
x
,
f32
y
,
f32
z
,
const
Self
&
n
)
621
{
622
ASM_MTXScaleApply
(
const_cast
<
f32
(*)[4]>(
n
.
m
),
m
,
x
,
y
,
z
);
623
}
624
625
#
endif
// cafe
626
627
template
<
typename
T
>
628
inline
void
629
Matrix34
<
T
>::
multTranslationWorld
(
const
Vec3
&
t
)
630
{
631
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
t
, *
this
);
632
}
633
634
template
<
typename
T
>
635
inline
void
636
Matrix34
<
T
>::
multTranslationWorld
(
T
x
,
T
y
,
T
z
)
637
{
638
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
Vec3
(
x
,
y
,
z
), *
this
);
639
}
640
641
#
ifdef
cafe
642
643
template
<>
644
inline
void
645
Matrix34
<
f32
>::
multTranslationWorld
(
f32
x
,
f32
y
,
f32
z
)
646
{
647
ASM_MTXTransApply
(
m
,
m
,
x
,
y
,
z
);
648
}
649
650
#
endif
// cafe
651
652
template
<
typename
T
>
653
inline
void
654
Matrix34
<
T
>::
setMultTranslationWorld
(
const
Vec3
&
t
,
const
Self
&
n
)
655
{
656
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
t
,
n
);
657
}
658
659
template
<
typename
T
>
660
inline
void
661
Matrix34
<
T
>::
setMultTranslationWorld
(
T
x
,
T
y
,
T
z
,
const
Self
&
n
)
662
{
663
Matrix34CalcCommon
<
T
>::
multTranslationWorld
(*
this
,
Vec3
(
x
,
y
,
z
),
n
);
664
}
665
666
#
ifdef
cafe
667
668
template
<>
669
inline
void
670
Matrix34
<
f32
>::
setMultTranslationWorld
(
f32
x
,
f32
y
,
f32
z
,
const
Self
&
n
)
671
{
672
ASM_MTXTransApply
(
const_cast
<
f32
(*)[4]>(
n
.
m
),
m
,
x
,
y
,
z
);
673
}
674
675
#
endif
// cafe
676
677
template
<
typename
T
>
678
inline
void
679
Matrix34
<
T
>::
getBase
(
Vec3
&
o
,
s32
axis
)
const
680
{
681
Matrix34CalcCommon
<
T
>::
getBase
(
o
, *
this
,
axis
);
682
}
683
684
template
<
typename
T
>
685
inline
Matrix34
<
T
>::
Vec3
686
Matrix34
<
T
>::
getBase
(
s32
axis
)
const
687
{
688
Vec3 o;
689
Matrix34CalcCommon
<
T
>::
getBase
(
o
, *
this
,
axis
);
690
return
o
;
691
}
692
693
template
<
typename
T
>
694
inline
void
695
Matrix34
<
T
>::
getRow
(
Vec4
&
o
,
s32
row
)
const
696
{
697
Matrix34CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
698
}
699
700
template
<
typename
T
>
701
inline
Matrix34
<
T
>::
Vec4
702
Matrix34
<
T
>::
getRow
(
s32
row
)
const
703
{
704
Vec4 o;
705
Matrix34CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
706
return
o
;
707
}
708
709
template
<
typename
T
>
710
inline
void
711
Matrix34
<
T
>::
getTranslation
(
Vec3
&
o
)
const
712
{
713
Matrix34CalcCommon
<
T
>::
getTranslation
(
o
, *
this
);
714
}
715
716
template
<
typename
T
>
717
inline
Matrix34
<
T
>::
Vec3
718
Matrix34
<
T
>::
getTranslation
()
const
719
{
720
Vec3 o;
721
Matrix34CalcCommon
<
T
>::
getTranslation
(
o
, *
this
);
722
return
o
;
723
}
724
725
template
<
typename
T
>
726
inline
void
727
Matrix34
<
T
>::
scaleAllElements
(
T
s
)
728
{
729
Matrix34CalcCommon
<
T
>::
scaleAllElements
(*
this
,
s
);
730
}
731
732
template
<
typename
T
>
733
inline
void
734
Matrix34
<
T
>::
scaleBases
(
T
s
)
735
{
736
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
s
,
s
,
s
);
737
}
738
739
template
<
typename
T
>
740
inline
void
741
Matrix34
<
T
>::
scaleBases
(
T
sx
,
T
sy
,
T
sz
)
742
{
743
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
sx
,
sy
,
sz
);
744
}
745
746
template
<
typename
T
>
747
inline
void
748
Matrix34
<
T
>::
scaleBases
(
const
Vec3
&
s
)
749
{
750
Matrix34CalcCommon
<
T
>::
scaleBases
(*
this
,
s
.
x
,
s
.
y
,
s
.
z
);
751
}
752
753
template
<
typename
T
>
754
inline
void
755
Matrix34
<
T
>::
setBase
(
s32
axis
,
const
Vec3
&
v
)
756
{
757
Matrix34CalcCommon
<
T
>::
setBase
(*
this
,
axis
,
v
);
758
}
759
760
template
<
typename
T
>
761
inline
void
762
Matrix34
<
T
>::
setRow
(
s32
row
,
const
Vec4
&
v
)
763
{
764
Matrix34CalcCommon
<
T
>::
setRow
(*
this
,
v
,
row
);
765
}
766
767
template
<
typename
T
>
768
inline
void
769
Matrix34
<
T
>::
setTranslation
(
const
Vec3
&
t
)
770
{
771
Matrix34CalcCommon
<
T
>::
setTranslation
(*
this
,
t
);
772
}
773
774
template
<
typename
T
>
775
inline
void
776
Matrix34
<
T
>::
setTranslation
(
T
x
,
T
y
,
T
z
)
777
{
778
Vec3 t(x, y, z);
779
Matrix34CalcCommon
<
T
>::
setTranslation
(*
this
,
t
);
780
}
781
782
template
<
typename
T
>
783
inline
784
Matrix44
<
T
>::
Matrix44
(
785
T
a00
,
T
a01
,
T
a02
,
T
a03
,
786
T
a10
,
T
a11
,
T
a12
,
T
a13
,
787
T
a20
,
T
a21
,
T
a22
,
T
a23
,
788
T
a30
,
T
a31
,
T
a32
,
T
a33
789
)
790
{
791
this
->
m
[0][0] =
a00
;
792
this
->
m
[0][1] =
a01
;
793
this
->
m
[0][2] =
a02
;
794
this
->
m
[0][3] =
a03
;
795
796
this
->
m
[1][0] =
a10
;
797
this
->
m
[1][1] =
a11
;
798
this
->
m
[1][2] =
a12
;
799
this
->
m
[1][3] =
a13
;
800
801
this
->
m
[2][0] =
a20
;
802
this
->
m
[2][1] =
a21
;
803
this
->
m
[2][2] =
a22
;
804
this
->
m
[2][3] =
a23
;
805
806
this
->
m
[3][0] =
a30
;
807
this
->
m
[3][1] =
a31
;
808
this
->
m
[3][2] =
a32
;
809
this
->
m
[3][3] =
a33
;
810
}
811
812
template
<
typename
T
>
813
inline
814
Matrix44
<
T
>::
Matrix44
(
const
Mtx33
&
mtx33
,
const
Vec3
&
t
,
const
Vec4
&
vw
)
815
{
816
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
mtx33
,
t
,
vw
);
817
}
818
819
template
<
typename
T
>
820
inline
821
Matrix44
<
T
>::
Matrix44
(
const
Mtx34
&
mtx34
,
const
Vec4
&
vw
)
822
{
823
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
mtx34
,
vw
);
824
}
825
826
template
<
typename
T
>
827
inline
T
828
Matrix44
<
T
>::
operator
()(
s32
i
,
s32
j
)
const
829
{
830
return
this
->
m
[
i
][
j
];
831
}
832
833
template
<
typename
T
>
834
inline
T
&
835
Matrix44
<
T
>::
operator
()(
s32
i
,
s32
j
)
836
{
837
return
this
->
m
[
i
][
j
];
838
}
839
840
template
<
typename
T
>
841
inline
Matrix44
<
T
>&
842
Matrix44
<
T
>::
operator
=(
const
Self
&
n
)
843
{
844
Matrix44CalcCommon
<
T
>::
copy
(*
this
,
n
);
845
return
*
this
;
846
}
847
848
template
<
typename
T
>
849
inline
void
850
Matrix44
<
T
>::
makeIdentity
()
851
{
852
Matrix44CalcCommon
<
T
>::
makeIdentity
(*
this
);
853
}
854
855
template
<
typename
T
>
856
inline
void
857
Matrix44
<
T
>::
makeZero
()
858
{
859
Matrix44CalcCommon
<
T
>::
makeZero
();
860
}
861
862
template
<
typename
T
>
863
inline
void
864
Matrix44
<
T
>::
setInverse
(
const
Self
&
n
)
865
{
866
Matrix44CalcCommon
<
T
>::
inverse
(*
this
,
n
);
867
}
868
869
template
<
typename
T
>
870
inline
void
871
Matrix44
<
T
>::
setMul
(
const
Self
&
a
,
const
Self
&
b
)
872
{
873
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
874
}
875
876
template
<
typename
T
>
877
inline
void
878
Matrix44
<
T
>::
setMul
(
const
Mtx34
&
a
,
const
Self
&
b
)
879
{
880
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
881
}
882
883
template
<
typename
T
>
884
inline
void
885
Matrix44
<
T
>::
setMul
(
const
Self
&
a
,
const
Mtx34
&
b
)
886
{
887
Matrix44CalcCommon
<
T
>::
multiply
(*
this
,
a
,
b
);
888
}
889
890
template
<
typename
T
>
891
inline
void
892
Matrix44
<
T
>::
setTranspose
(
const
Self
&
n
)
893
{
894
Matrix44CalcCommon
<
T
>::
transposeTo
(*
this
,
n
);
895
}
896
897
template
<
typename
T
>
898
inline
void
899
Matrix44
<
T
>::
transpose
()
900
{
901
Matrix44CalcCommon
<
T
>::
transpose
(*
this
);
902
}
903
904
template
<
typename
T
>
905
inline
void
906
Matrix44
<
T
>::
fromQuat
(
const
Quat
&
q
)
907
{
908
Matrix44CalcCommon
<
T
>::
makeQ
(*
this
,
q
);
909
}
910
911
template
<
typename
T
>
912
inline
void
913
Matrix44
<
T
>::
makeR
(
const
Vec3
&
r
)
914
{
915
Matrix44CalcCommon
<
T
>::
makeR
(*
this
,
r
);
916
}
917
918
template
<
typename
T
>
919
inline
void
920
Matrix44
<
T
>::
makeRIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
921
{
922
Matrix44CalcCommon
<
T
>::
makeRIdx
(*
this
,
xr
,
yr
,
zr
);
923
}
924
925
template
<
typename
T
>
926
inline
void
927
Matrix44
<
T
>::
makeRzxyIdx
(
u32
xr
,
u32
yr
,
u32
zr
)
928
{
929
Matrix44CalcCommon
<
T
>::
makeRzxyIdx
(*
this
,
xr
,
yr
,
zr
);
930
}
931
932
template
<
typename
T
>
933
inline
void
934
Matrix44
<
T
>::
toQuat
(
Quat
&
q
)
const
935
{
936
Matrix44CalcCommon
<
T
>::
toQuat
(
q
, *
this
);
937
}
938
939
template
<
typename
T
>
940
inline
void
941
Matrix44
<
T
>::
getCol
(
Vec4
&
o
,
s32
axis
)
const
942
{
943
Matrix44CalcCommon
<
T
>::
getCol
(
o
, *
this
,
axis
);
944
}
945
946
template
<
typename
T
>
947
inline
Matrix44
<
T
>::
Vec4
948
Matrix44
<
T
>::
getCol
(
s32
axis
)
const
949
{
950
Vec4 o;
951
Matrix44CalcCommon
<
T
>::
getCol
(
o
, *
this
,
axis
);
952
return
o
;
953
}
954
955
template
<
typename
T
>
956
inline
void
957
Matrix44
<
T
>::
getRow
(
Vec4
&
o
,
s32
row
)
const
958
{
959
Matrix44CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
960
}
961
962
template
<
typename
T
>
963
inline
Matrix44
<
T
>::
Vec4
964
Matrix44
<
T
>::
getRow
(
s32
row
)
const
965
{
966
Vec4 o;
967
Matrix44CalcCommon
<
T
>::
getRow
(
o
, *
this
,
row
);
968
return
o
;
969
}
970
971
template
<
typename
T
>
972
inline
void
973
Matrix44
<
T
>::
scaleAllElements
(
T
s
)
974
{
975
Matrix44CalcCommon
<
T
>::
scaleAllElements
(*
this
,
s
);
976
}
977
978
template
<
typename
T
>
979
inline
void
980
Matrix44
<
T
>::
scaleBases
(
T
sx
,
T
sy
,
T
sz
,
T
sw
)
981
{
982
Matrix44CalcCommon
<
T
>::
scaleBases
(*
this
,
sx
,
sy
,
sz
,
sw
);
983
}
984
985
template
<
typename
T
>
986
inline
void
987
Matrix44
<
T
>::
setCol
(
s32
axis
,
const
Vec4
&
v
)
988
{
989
Matrix44CalcCommon
<
T
>::
setCol
(*
this
,
axis
,
v
);
990
}
991
992
template
<
typename
T
>
993
inline
void
994
Matrix44
<
T
>::
setRow
(
s32
row
,
const
Vec4
&
v
)
995
{
996
Matrix44CalcCommon
<
T
>::
setRow
(*
this
,
v
,
row
);
997
}
998
999
}
// namespace sead
sead
Definition
seadAssert.h:44
engine
library
include
math
seadMatrix.hpp
Generated by
1.14.0