Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5052 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Aug 16, 2005, 10:32:46 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Vector and Quaternion comparison

File:
1 edited

Legend:

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

    r5008 r5052  
    2727  ~Vector () {}
    2828
     29  /** @param v: the Vecor to compare with this one @returns true, if the Vecors are the same, false otherwise */
     30  inline bool operator== (const Vector& v) const { return (this->x==v.x&&this->y==v.y&&this->z==v.z)?true:false; };
    2931  /** @param index The index of the "array" @returns the x/y/z coordinate */
    3032  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
     
    127129  Quaternion (const Vector& dir, const Vector& up);
    128130  Quaternion (float roll, float pitch, float yaw);
     131
     132  /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
     133  inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
    129134  /** @param f: a real value @return a Quaternion containing the quotient */
    130135  inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); };
Note: See TracChangeset for help on using the changeset viewer.