Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5665 in orxonox.OLD for trunk/src/lib/math/matrix.h


Ignore:
Timestamp:
Nov 21, 2005, 10:17:56 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: optimized matrix

File:
1 edited

Legend:

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

    r5664 r5665  
    2929    };
    3030
    31     Matrix operator+ (const Matrix& m) {
     31    Matrix operator+ (const Matrix& m) const {
    3232      return Matrix (this->m11 + m.m11, this->m12 + m.m12, this->m13 + m.m13,
    3333                     this->m21 + m.m21, this->m22 + m.m22, this->m23 + m.m23,
     
    3535    }
    3636
    37     Matrix operator- (const Matrix& m) {
     37    Matrix operator- (const Matrix& m) const {
    3838      return Matrix (this->m11 - m.m11, this->m12 - m.m12, this->m13 - m.m13,
    3939                     this->m21 - m.m21, this->m22 - m.m22, this->m23 - m.m23,
     
    4141    }
    4242
    43     Matrix operator* (float k) {
     43    Matrix operator* (float k) const {
    4444      return Matrix(this->m11 - k, this->m12 - k, this->m13 - k,
    4545                    this->m21 - k, this->m22 - k, this->m23 - k,
     
    4747    }
    4848
    49     Vector operator* (const Vector& v) {
     49    Vector operator* (const Vector& v) const {
    5050      return Vector (this->m11*v.x + this->m12*v.y + this->m13*v.z,
    5151                     this->m21*v.x + this->m22*v.y + this->m23*v.z,
     
    5555
    5656
    57     Matrix getTransposed() {
     57    Matrix getTransposed() const {
    5858      return Matrix( this->m11, this->m21, this->m31,
    5959                     this->m12, this->m22, this->m32,
     
    6161    }
    6262
    63     void toVectors(Vector& m1, Vector& m2, Vector& m3) {
     63    void toVectors(Vector& m1, Vector& m2, Vector& m3) const {
    6464      m1 = Vector(this->m11, this->m12, this->m13);
    6565      m2 = Vector(this->m21, this->m22, this->m23);
     
    6767    }
    6868
     69    Vector eigenValues() const;
     70    void eigenVectors(Vector& a, Vector& b, Vector& c) const;
    6971
    7072    /// @todo optimize
    7173    static Matrix identity() { return Matrix (1,0,0, 0,1,0, 0,0,1); }
    7274
    73     void eigVl(const Matrix& matrix);
    7475    void debug() const;
    7576
Note: See TracChangeset for help on using the changeset viewer.