Changeset 5053 in orxonox.OLD for orxonox/trunk/src/lib/math
- Timestamp:
- Aug 16, 2005, 11:28:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.h
r5052 r5053 72 72 inline float len() const { return sqrt (x*x+y*y+z*z); } 73 73 /** normalizes the vector */ 74 inline void normalize() { 75 float l = len(); 76 if( unlikely(l == 0.0)) 77 { 78 // Prevent divide by zero 79 return; 80 } 81 x = x / l; 82 y = y / l; 83 z = z / l; 84 } 74 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; }; 85 75 Vector getNormalized() const; 86 76 Vector abs();
Note: See TracChangeset
for help on using the changeset viewer.