blob: 0ac0f68a111badbe6319d4ea17e446609a628dce (
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
59
60
61
|
/*
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 "math/axis.h"
namespace math
{
/// a transformation matrix
class Matrix4f
{
public:
/// default constructor
Matrix4f();
/// copy constructor
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
const Matrix4f transpose() const;
private:
float _matrix[4][4];
};
}
#endif // __INCLUDED_MATH_MATRIX4F_H__
|