summaryrefslogtreecommitdiff
path: root/include/JSystem/TPosition3.h
blob: 2e77b4ebbeb535b116aa4f0f6d0bb002fb960a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef TPOSITION3_H
#define TPOSITION3_H

#include "dolphin/mtx/mtx.h"
#include "JSystem/JMath/JMath.h"

namespace JGeometry {

template <typename T>
struct SMatrix34C {
    T data[3][4];
};

template <>
struct SMatrix34C<f32> {
    f32 data[3][4];

    void identity() { MTXIdentity(data); }

    typedef f32 ArrType[4];
    void set(const ArrType* src) { JMath::gekko_ps_copy12((f32*)data, (f32*)src); }

    operator ArrType*() const { return (ArrType*)data; }
    operator const ArrType*() const { return data; }
};

template <typename T>
struct TMatrix34 : public T {};

template <typename T>
struct TRotation3 : public T {};

template <typename T>
struct TPosition3 : public T {};

typedef TPosition3<TRotation3<TMatrix34<SMatrix34C<f32> > > > TPosition3f32;

}  // namespace JGeometry

#endif