Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2005, 11:29:37 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: Vector: interface definitions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/math/vector.h

    r3960 r3963  
    3131
    3232  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }
    33   inline const Vector operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;}
     33  inline const Vector& operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;}
    3434  inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); }
    35   inline const Vector operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;}
     35  inline const Vector& operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;}
    3636  inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; }
    37   inline const Vector operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;}
     37  inline const Vector& operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;}
    3838  inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); }
    39   inline const Vector operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;}
     39  inline const Vector& operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;}
    4040  Vector operator/ (float f) const;
    41   inline const Vector operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;}
    42   inline const Vector operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;}
     41  inline const Vector& operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;}
     42  inline const Vector& operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;}
    4343  float dot (const Vector& v) const;
    4444  inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
     
    5656                      z = z / l;
    5757                    }
    58   const Vector getNormalized();
     58  Vector getNormalized();
    5959  Vector abs();
    6060
     
    8282  Quaternion (float roll, float pitch, float yaw);
    8383  Quaternion operator/ (const float& f) const;
     84  inline const Quaternion operator/= (const float& f) {*this = *this / f; return *this;}
    8485  Quaternion operator* (const float& f) const;
     86  inline const Quaternion operator*= (const float& f) {*this = *this * f; return *this;}
    8587  Quaternion operator* (const Quaternion& q) const;
     88  inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this;}
    8689  inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); }
     90  inline const Quaternion& operator+= (const Quaternion& q) {this->v += q.v; this->w += q.w; return *this;}
    8791  inline Quaternion operator- (const Quaternion& q) const { return Quaternion(q.v - v, q.w - w); }
     92  inline const Quaternion& operator-= (const Quaternion& q) {this->v -= q.v; this->w -= q.w; return *this;}
    8893  inline Quaternion operator= (const Quaternion& q) {this->v = q.v; this->w = q.w; return *this;}
    8994  Quaternion conjugate () const {  Quaternion r(*this);
     
    9499  float norm () const;
    95100  void matrix (float m[4][4]) const;
    96   void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
     101  Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
    97102 
    98103  void debug();
Note: See TracChangeset for help on using the changeset viewer.