Index: /orxonox/trunk/src/lib/math/vector.cc
===================================================================
--- /orxonox/trunk/src/lib/math/vector.cc	(revision 4476)
+++ /orxonox/trunk/src/lib/math/vector.cc	(revision 4477)
@@ -24,4 +24,7 @@
 using namespace std;
 
+/////////////
+/* VECTORS */
+/////////////
 /**
    \brief returns the this-vector normalized to length 1.0
@@ -43,4 +46,15 @@
 
 /**
+   \brief Vector is looking in the positive direction on all axes after this
+*/
+Vector Vector::abs() 
+{
+  Vector v(fabs(x), fabs(y), fabs(z));
+  return v;
+}
+
+
+
+/**
    \brief Outputs the values of the Vector
 */
@@ -53,18 +67,7 @@
 }
 
-/**
-	\brief creates a multiplicational identity Quaternion
-*/
-//Quaternion::Quaternion ()
-
-
-/**
-	\brief turns a rotation along an axis into a Quaternion
-	\param angle: the amount of radians to rotate
-	\param axis: the axis to rotate around
-*/
-//Quaternion::Quaternion (float angle, const Vector& axis)
-
-
+/////////////////
+/* QUATERNIONS */
+/////////////////
 /**
    \brief calculates a lookAt rotation
@@ -109,38 +112,35 @@
 
 /**
-	\brief calculates a rotation from euler angles
-	\param roll: the roll in radians
-	\param pitch: the pitch in radians
-	\param yaw: the yaw in radians
-	
-	I DO HONESTLY NOT EXACTLY KNOW WHICH ANGLE REPRESENTS WHICH ROTATION. And I do not know 
-	in what order they are applied,	I just copy-pasted the code.
+   \brief calculates a rotation from euler angles
+   \param roll: the roll in radians
+   \param pitch: the pitch in radians
+   \param yaw: the yaw in radians
 */
 Quaternion::Quaternion (float roll, float pitch, float yaw)
 {
-	float cr, cp, cy, sr, sp, sy, cpcy, spsy;
-	
-	// calculate trig identities
-	cr = cos(roll/2);
-	cp = cos(pitch/2);
-	cy = cos(yaw/2);
-	
-	sr = sin(roll/2);
-	sp = sin(pitch/2);
-	sy = sin(yaw/2);
-	
-	cpcy = cp * cy;
-	spsy = sp * sy;
-	
-	w = cr * cpcy + sr * spsy;
-	v.x = sr * cpcy - cr * spsy;
-	v.y = cr * sp * cy + sr * cp * sy;
-	v.z = cr * cp * sy - sr * sp * cy;
-}
-
-/**
-	\brief rotates one Quaternion by another
-	\param q: another Quaternion to rotate this by
-	\return a quaternion that represents the first one rotated by the second one (WARUNING: this operation is not commutative! e.g. (A*B) != (B*A))
+  float cr, cp, cy, sr, sp, sy, cpcy, spsy;
+  
+  // calculate trig identities
+  cr = cos(roll/2);
+  cp = cos(pitch/2);
+  cy = cos(yaw/2);
+  
+  sr = sin(roll/2);
+  sp = sin(pitch/2);
+  sy = sin(yaw/2);
+  
+  cpcy = cp * cy;
+  spsy = sp * sy;
+  
+  w = cr * cpcy + sr * spsy;
+  v.x = sr * cpcy - cr * spsy;
+  v.y = cr * sp * cy + sr * cp * sy;
+  v.z = cr * cp * sy - sr * sp * cy;
+}
+
+/**
+   \brief rotates one Quaternion by another
+   \param q: another Quaternion to rotate this by
+   \return a quaternion that represents the first one rotated by the second one (WARUNING: this operation is not commutative! e.g. (A*B) != (B*A))
 */
 Quaternion Quaternion::operator*(const Quaternion& q) const
@@ -165,34 +165,4 @@
   return r;
 }
-
-/**
-   \brief add two Quaternions
-   \param q: another Quaternion
-   \return the sum of both Quaternions
-*/
-/*
-Quaternion Quaternion::operator+(const Quaternion& q) const
-{
-  Quaternion r(*this);
-  r.w = r.w + q.w;
-  r.v = r.v + q.v;
-  return r;
-}
-*/
-
-/**
-   \brief subtract two Quaternions
-   \param q: another Quaternion
-   \return the difference of both Quaternions
-*/
-/*
-Quaternion Quaternion::operator- (const Quaternion& q) const
-{
-  Quaternion r(*this);
-  r.w = r.w - q.w;
-  r.v = r.v - q.v;
-  return r;
-}
-*/
 
 /**
Index: /orxonox/trunk/src/lib/math/vector.h
===================================================================
--- /orxonox/trunk/src/lib/math/vector.h	(revision 4476)
+++ /orxonox/trunk/src/lib/math/vector.h	(revision 4477)
@@ -52,5 +52,5 @@
   /** \param v: the corss-product partner \returns the cross-product between this and v (this (x) v) */
   inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
-  /** \param scales the this vector with v */
+  /** \brief scales the this vector with v  \param v the vector to scale this with */
   void scale(const Vector& v) {   x *= v.x;  y *= v.y; z *= v.z; };
   /** \returns the length of the vector */
@@ -102,27 +102,34 @@
 {
  public:
-  Vector    v;        //!< Imaginary Vector
-  float     w;        //!< Real part of the number
-  
+  /** \brief creates a Default quaternion (multiplicational identity Quaternion)*/
   inline Quaternion () { w = 1; v = Vector(0,0,0); }
+  /** \brief creates a Quaternion looking into the direction v \param v: the direction \param f: the value */
   inline Quaternion (const Vector& v, float f) { this->w = f; this->v = v; }
   Quaternion (float m[4][4]);
+  /** \brief turns a rotation along an axis into a Quaternion \param angle: the amount of radians to rotate \param axis: the axis to rotate around */
   inline Quaternion (float angle, const Vector& axis) { w = cos(angle/2); v = axis * sin(angle/2); }
   Quaternion (const Vector& dir, const Vector& up);
   Quaternion (float roll, float pitch, float yaw);
   Quaternion operator/ (const float& f) const;
-  inline const Quaternion operator/= (const float& f) {*this = *this / f; return *this;}
+  /** \param f: the value to divide by \returns the quaternion devided by f (this /= f) */
+  inline const Quaternion& operator/= (const float& f) {*this = *this / f; return *this;}
   Quaternion operator* (const float& f) const;
-  inline const Quaternion operator*= (const float& f) {*this = *this * f; return *this;}
+  /** \param f: the value to multiply by \returns the quaternion multiplied by f (this *= f) */
+  inline const Quaternion& operator*= (const float& f) {*this = *this * f; return *this;}
   Quaternion operator* (const Quaternion& q) const;
-  inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this;}
-  inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); }
-  inline const Quaternion& operator+= (const Quaternion& q) {this->v += q.v; this->w += q.w; return *this;}
+  /** \param q: the Quaternion to multiply by \returns the quaternion multiplied by q (this *= q) */  
+  inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this; };
+  /** \param q the Quaternion to add to this \returns the quaternion added with q (this + q) */
+  inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); };
+  /** \param q the Quaternion to add to this \returns the quaternion added with q (this += q) */
+  inline const Quaternion& operator+= (const Quaternion& q) { this->v += q.v; this->w += q.w; return *this; };
+  /** \param q the Quaternion to substrace from this \returns the quaternion substracted by q (this - q) */
   inline Quaternion operator- (const Quaternion& q) const { return Quaternion(q.v - v, q.w - w); }
-  inline const Quaternion& operator-= (const Quaternion& q) {this->v -= q.v; this->w -= q.w; return *this;}
+  /** \param q the Quaternion to substrace from this \returns the quaternion substracted by q (this -= q) */
+  inline const Quaternion& operator-= (const Quaternion& q) { this->v -= q.v; this->w -= q.w; return *this; };
+  /** \brief copy constructor \param q: the Quaternion to set this to. \returns the Quaternion q (or this) */
   inline Quaternion operator= (const Quaternion& q) {this->v = q.v; this->w = q.w; return *this;}
-  Quaternion conjugate () const {  Quaternion r(*this);
-  r.v = Vector() - r.v;
-  return r;}
+  /** \brief conjugates this Quaternion \returns the conjugate */
+  inline Quaternion conjugate () const {  Quaternion r(*this);  r.v = Vector() - r.v;  return r;}
   Quaternion inverse () const;
   Vector apply (const Vector& f) const;
@@ -131,4 +138,9 @@
   
   void debug();
+
+ public:
+  Vector    v;        //!< Imaginary Vector
+  float     w;        //!< Real part of the number
+
 };
 
