Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3819 in orxonox.OLD for orxonox/trunk/src/lib/math/vector.cc


Ignore:
Timestamp:
Apr 14, 2005, 12:21:27 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: most important often used functions inlined

File:
1 edited

Legend:

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

    r3818 r3819  
    2323#include "vector.h"
    2424#include "debug.h"
    25 #include "stdincl.h"
    2625
    2726using namespace std;
     
    9089        \return the cross product of the vectors
    9190*/
    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
    9693 
    9794/**
    9895   \brief normalizes the vector to lenght 1.0
    9996*/
    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 ()
    11498
    11599
     
    149133   \return the lenght of the vector
    150134*/
    151 float Vector::len () const
    152 {
    153   return sqrt (x*x+y*y+z*z);
    154 }
     135//float Vector::len () const
    155136
    156137
Note: See TracChangeset for help on using the changeset viewer.