Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2005, 2:49:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: some more functionality to the vectors-class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/math/vector.cc

    r3951 r3958  
    100100*/
    101101
    102 Vector* Vector::getNormalized()
     102const Vector Vector::getNormalized()
    103103{
    104104  float l = len();
    105105  if(unlikely(l != 1.0))
    106106    {
    107       return this;
     107      return *this;
    108108    }
    109109  else if(unlikely(l == 0.0))
    110110    {
    111       return 0;
     111      return Vector();
    112112    }
    113113
    114   return new Vector(x / l, y /l, z / l);
     114  return Vector(x / l, y /l, z / l);
    115115}
    116116
Note: See TracChangeset for help on using the changeset viewer.