Changeset 9110 in orxonox.OLD for trunk/src/lib/math/vector.h
- Timestamp:
- Jul 4, 2006, 11:18:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/vector.h
r8894 r9110 24 24 #define __VECTOR_H_ 25 25 26 #include < math.h>26 #include <cmath> 27 27 #include "compiler.h" 28 28 //! PI the circle-constant … … 42 42 Vector (float x, float y, float z) : x(x), y(y), z(z) {} //!< assignment constructor 43 43 Vector () : x(0), y(0), z(0) {} 44 ~Vector () {}45 44 46 45 /** @param v: the Vecor to compare with this one @returns true, if the Vecors are the same, false otherwise */ … … 90 89 void scale(const Vector& v) { x *= v.x; y *= v.y; z *= v.z; }; 91 90 /** @returns the length of the vector */ 92 inline float len() const { return sqrt (x*x +y*y+z*z); }91 inline float len() const { return sqrt (x*x + y*y + z*z); } 93 92 /** normalizes the vector */ 94 93 inline void normalize() { float l = len(); if( unlikely(l == 0.0))return; this->x=this->x/l; this->y=this->y/l; this->z=this->z/l; };
Note: See TracChangeset
for help on using the changeset viewer.