blob: 41488702ab024132e353b7a5929cc10cfa3309fb (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/*
math/matrix4f.cc
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_MATH_MATRIX4F_H__
#define __INCLUDED_MATH_MATRIX4F_H__
#include <iostream>
#include "math/axis.h"
namespace math
{
/// a transformation matrix
class Matrix4f
{
public:
Matrix4f();
Matrix4f(const Matrix4f & other);
Matrix4f(const Axis & axis);
/// set all values to zero
void clear();
/// set the value to a 4x4 unity matrix
void unity();
/// assignment operator
void assign(const Matrix4f & other);
/// assignment operator
inline Matrix4f & operator=(const Matrix4f &other);
/// assign the matrix transformation equivalent to the coordinate system
void assign(const Axis & axis);
/// assign the matrix transformation equivalent to the coordinate system
Matrix4f & operator=(const Axis & axis);
/// return a pointer to the internal data
inline float * ptr() const {
return (float *) matrix;
}
/// return the transpose matrix
Matrix4f const transpose();
private:
float matrix[4][4];
};
}
#endif // __INCLUDED_MATH_MATRIX4F_H__
|