Changeset 3819 in orxonox.OLD for orxonox/trunk/src/lib/math/vector.cc
- Timestamp:
- Apr 14, 2005, 12:21:27 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.cc
r3818 r3819 23 23 #include "vector.h" 24 24 #include "debug.h" 25 #include "stdincl.h"26 25 27 26 using namespace std; … … 90 89 \return the cross product of the vectors 91 90 */ 92 Vector Vector::cross (const Vector& v) const 93 { 94 return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); 95 } 91 //Vector Vector::cross (const Vector& v) const 92 96 93 97 94 /** 98 95 \brief normalizes the vector to lenght 1.0 99 96 */ 100 void Vector::normalize () 101 { 102 float l = len(); 103 104 __UNLIKELY_IF( l == 0.0) 105 { 106 // Prevent divide by zero 107 return; 108 } 109 110 x = x / l; 111 y = y / l; 112 z = z / l; 113 } 97 //void Vector::normalize () 114 98 115 99 … … 149 133 \return the lenght of the vector 150 134 */ 151 float Vector::len () const 152 { 153 return sqrt (x*x+y*y+z*z); 154 } 135 //float Vector::len () const 155 136 156 137
Note: See TracChangeset
for help on using the changeset viewer.