Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5663 in orxonox.OLD


Ignore:
Timestamp:
Nov 21, 2005, 3:25:41 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: more oo-style matrix

Location:
trunk/src/lib/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/math/matrix.cc

    r5662 r5663  
    7979  }
    8080
    81   Matrix M;
     81  Matrix M = *this -  Matrix::identity() * eigValue[0];
    8282
    8383  float u11, u12, u13, u22, u23, u33;
  • trunk/src/lib/math/matrix.h

    r5662 r5663  
    44class Matrix
    55{
     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
    644  public:
    745    float m11;    float m12;     float m13;
     
    947    float m31;    float m32;     float m33;
    1048
    11     void eigVl(const Matrix& matrix);
    12     void debug() const;
    1349};
Note: See TracChangeset for help on using the changeset viewer.