-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGeometryTypes.h
More file actions
69 lines (55 loc) · 1.03 KB
/
GeometryTypes.h
File metadata and controls
69 lines (55 loc) · 1.03 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// GeometryTypes.h
//
//
// Created by DarkTango on 4/13/15.
//
//
#ifndef Example_MarkerBasedAR_GeometryTypes_hpp
#define Example_MarkerBasedAR_GeometryTypes_hpp
struct Matrix44
{
union
{
float data[16];
float mat[4][4];
};
Matrix44 getTransposed() const;
Matrix44 getInvertedRT() const;
static Matrix44 identity();
};
struct Matrix33
{
union
{
float data[9];
float mat[3][3];
};
static Matrix33 identity();
Matrix33 getTransposed() const;
};
struct Vector4
{
float data[4];
};
struct Vector3
{
float data[3];
static Vector3 zero();
Vector3 operator-() const;
};
struct Transformation
{
Transformation();
Transformation(const Matrix33& r, const Vector3& t);
Matrix33& r();
Vector3& t();
const Matrix33& r() const;
const Vector3& t() const;
Matrix44 getMat44() const;
Transformation getInverted() const;
private:
Matrix33 m_rotation;
Vector3 m_translation;
};
#endif