Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 13, 2005, 10:02:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: optimizations

File:
1 edited

Legend:

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

    r4966 r4992  
    2929  /** @param index The index of the "array" @returns the x/y/z coordinate */
    3030  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
    31   /*** @param v The vector to add @returns the addition between two vectors (this + v) */
     31  /** @param v The vector to add @returns the addition between two vectors (this + v) */
    3232  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
    33   /*** @param v The vector to add @returns the addition between two vectors (this + v) */
     33  /** @param v The vector to add @returns the addition between two vectors (this + v) */
    3434  inline Vector operator+ (const sVec3D& v) const { return Vector(x + v[0], y + v[1], z + v[2]); };
    3535  /** @param v The vector to add  @returns the addition between two vectors (this += v) */
     
    5757  /** @param f a factor to divide the vector with @returns the vector divided by f (this /= f) */
    5858  inline const Vector& operator/= (float f) {if (unlikely(f == 0.0)) {this->x=0;this->y=0;this->z=0;} else {this->x /= f; this->y /= f; this->z /= f;} return *this; };
    59   /** \brief copy constructor @todo (i do not know it this is faster) @param v the vector to assign to this vector. @returns the vector v */
     59  /** copy constructor @todo (i do not know it this is faster) @param v the vector to assign to this vector. @returns the vector v */
    6060  inline const Vector& operator= (const Vector& v) { this->x = v.x; this->y = v.y; this->z = v.z; return *this; };
    61   /** \brief copy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */
     61  /** copy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */
    6262  inline const Vector& operator= (const sVec3D& v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; }
    6363  /** @param v: the other vector \return the dot product of the vectors */
     
    6565  /** @param v: the corss-product partner @returns the cross-product between this and v (this (x) v) */
    6666  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 ); }
    67   /** \brief scales the this vector with v* @param v the vector to scale this with */
     67  /** scales the this vector with v* @param v the vector to scale this with */
    6868  void scale(const Vector& v) {   x *= v.x;  y *= v.y; z *= v.z; };
    6969  /** @returns the length of the vector */
    7070  inline float len() const { return sqrt (x*x+y*y+z*z); }
    71   /** \brief normalizes the vector */
     71  /** normalizes the vector */
    7272  inline void normalize() {
    7373                      float l = len();
Note: See TracChangeset for help on using the changeset viewer.