Changeset 9092 in orxonox.OLD for branches/presentation/src/lib/math/vector.h
- Timestamp:
- Jul 4, 2006, 2:38:00 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/math/vector.h
r9090 r9092 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 … … 89 89 void scale(const Vector& v) { x *= v.x; y *= v.y; z *= v.z; }; 90 90 /** @returns the length of the vector */ 91 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); } 92 92 /** normalizes the vector */ 93 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.