Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/math/matrix.h @ 5663

Last change on this file since 5663 was 5663, checked in by bensch, 18 years ago

orxonox/trunk: more oo-style matrix

File size: 1.4 KB
Line 
1
2
3
4class Matrix
5{
6
7  public:
8    Matrix ( float m11, float m12, float m13,
9             float m21, float m22, float m23,
10             float m31, float m32, float m33 )
11    {
12      this->m11 = m11; this->m12 = m12; this->m13 = m13;
13      this->m21 = m21; this->m22 = m22; this->m23 = m23;
14      this->m31 = m31; this->m32 = m32; this->m33 = m33;
15    }
16
17    Matrix operator+ (const Matrix& m)
18    {
19      return Matrix (this->m11 + m.m11, this->m12 + m.m12, this->m13 + m.m13,
20                     this->m21 + m.m21, this->m22 + m.m22, this->m23 + m.m23,
21                     this->m31 + m.m31, this->m32 + m.m32, this->m33 + m.m33);
22    }
23
24    Matrix operator- (const Matrix& m)
25    {
26      return Matrix (this->m11 - m.m11, this->m12 - m.m12, this->m13 - m.m13,
27                     this->m21 - m.m21, this->m22 - m.m22, this->m23 - m.m23,
28                     this->m31 - m.m31, this->m32 - m.m32, this->m33 - m.m33);
29    }
30
31    Matrix operator* (float k)
32    {
33      return Matrix(this->m11 - k, this->m12 - k, this->m13 - k,
34                    this->m21 - k, this->m22 - k, this->m23 - k,
35                    this->m31 - k, this->m32 - k, this->m33 - k);
36    }
37
38    static Matrix identity() {  return Matrix (1,0,0, 0,1,0, 0,0,1);    }
39
40    void eigVl(const Matrix& matrix);
41    void debug() const;
42
43
44  public:
45    float m11;    float m12;     float m13;
46    float m21;    float m22;     float m23;
47    float m31;    float m32;     float m33;
48
49};
Note: See TracBrowser for help on using the repository browser.