Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
TPosition3.hh
Go to the documentation of this file.
1#ifndef TPOSITION3_H
2#define TPOSITION3_H
3
4#include "dolphin/mtx.h"
6#include "JSystem/JGeometry.h"
7
8namespace JGeometry {
9
10template <typename T>
11struct SMatrix34C {
12 T data[3][4];
13};
14
15template <>
16struct SMatrix34C<f32> {
17 f32 data[3][4];
18
20
21 typedef f32 ArrType[4];
22 void set(const ArrType* src) {
24 }
25
26 operator ArrType*() { return data; }
27 operator const ArrType*() const { return data; }
28};
29
30template <typename T>
31struct SMatrix33C {
32 T data[3][3];
33
34 inline T& ref(int i, int j) {
35 return data[i][j];
36 }
37
38 inline T at(int i, int j) {
39 return data[i][j];
40 }
41
42 inline void set(T param_1, T param_2, T param_3, T param_4, T param_5,
44 ref(0,0) = param_1;
45 ref(0,1) = param_2;
46 ref(0,2) = param_3;
47 ref(1,0) = param_4;
48 ref(1,1) = param_5;
49 ref(1,2) = param_6;
50 ref(2,0) = param_7;
51 ref(2,1) = param_8;
52 ref(2,2) = param_9;
53 }
54
56 if (at(2, 0) - TUtil<T>::one() >= TUtil<T>::epsilon()) {
57 param_1->set(TUtil<T>::atan2(at(0,1), at(1,1)), -TUtil<T>::halfPI(), 0.0);
58 } else {
59 if (at(2, 0) - TUtil<T>::one() >= TUtil<T>::one() + TUtil<T>::epsilon()) {
60 param_1->set(TUtil<T>::atan2(at(0, 1), at(1, 1)), TUtil<T>::halfPI(),
61 0.0);
62 } else {
63 param_1->x = TUtil<T>::atan2(at(2, 1), at(2, 2));
64 param_1->z = TUtil<T>::atan2(at(0, 1), at(0, 0));
65 param_1->y = TUtil<T>::asin(at(2, 0));
66 }
67 }
68 }
69};
70
71template <typename T>
72struct TMatrix34 : public T {};
73
74template <typename T>
75struct TRotation3 : public T {};
76
77template <typename T>
78struct TPosition3 : public T {};
79
81
82} // namespace JGeometry
83
84#endif
T cLib_calcTimer(T *value)
Definition c_lib.h:74
int i
Definition e_pow.c:165
int j
Definition e_pow.c:165
static const double T[]
Definition k_tan.c:106
Definition JGeometry.h:8
TPosition3< TRotation3< TMatrix34< SMatrix34C< f32 > > > > TPosition3f32
Definition TPosition3.hh:80
void gekko_ps_copy12(register void *dst, register const void *src)
Definition JMath.h:105
Definition TPosition3.hh:31
T data[3][3]
Definition TPosition3.hh:32
T at(int i, int j)
Definition TPosition3.hh:38
void getEulerXYZ(TVec3< T > *param_1)
Definition TPosition3.hh:55
void set(T param_1, T param_2, T param_3, T param_4, T param_5, T param_6, T param_7, T param_8, T param_9)
Definition TPosition3.hh:42
T & ref(int i, int j)
Definition TPosition3.hh:34
void identity()
Definition TPosition3.hh:19
void set(const ArrType *src)
Definition TPosition3.hh:22
Definition TPosition3.hh:11
T data[3][4]
Definition TPosition3.hh:12
Definition TPosition3.hh:72
Definition TPosition3.hh:78
Definition TPosition3.hh:75
Definition JGeometry.h:11
Definition JGeometry.h:55
float f32
Definition types.h:22