Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10698 in orxonox.OLD for trunk/src/lib/math/vector.h


Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

File:
1 edited

Legend:

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

    r10376 r10698  
    5151
    5252  /** @param index The index of the "array" @returns the x/y/z coordinate */
    53   inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
     53  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; else return this->x; }
    5454  /** @param v The vector to add @returns the addition between two vectors (this + v) */
    5555  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
     
    6464  /** @param v The vector to substract  @returns the substraction between two vectors (this - v) */
    6565  inline Vector operator- (const sVec3D& v) const { return Vector(x - v[0], y - v[1], z - v[2]); }
     66  /** @returns the substraction between (0, 0, 0) and this (null-this) */
     67  inline Vector operator- () const { return Vector(-x, -y, -z); }
    6668  /** @param v The vector to substract  @returns the substraction between two vectors (this -= v) */
    6769  inline const Vector& operator-= (const Vector& v) { this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this; };
Note: See TracChangeset for help on using the changeset viewer.