Changeset 3958 in orxonox.OLD for orxonox/branches/particleEngine/src/lib/math/vector.cc
- Timestamp:
- Apr 25, 2005, 2:49:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/math/vector.cc
r3951 r3958 100 100 */ 101 101 102 Vector*Vector::getNormalized()102 const Vector Vector::getNormalized() 103 103 { 104 104 float l = len(); 105 105 if(unlikely(l != 1.0)) 106 106 { 107 return this;107 return *this; 108 108 } 109 109 else if(unlikely(l == 0.0)) 110 110 { 111 return 0;111 return Vector(); 112 112 } 113 113 114 return newVector(x / l, y /l, z / l);114 return Vector(x / l, y /l, z / l); 115 115 } 116 116
Note: See TracChangeset
for help on using the changeset viewer.