Index: /trunk/src/lib/Makefile.am
===================================================================
--- /trunk/src/lib/Makefile.am	(revision 6615)
+++ /trunk/src/lib/Makefile.am	(revision 6616)
@@ -43,4 +43,5 @@
                         util/executor/executor.cc \
                         math/vector.cc \
+                        math/quaternion.cc \
                         math/vector2D.cc \
                         math/matrix.cc \
@@ -64,4 +65,5 @@
                         util/executor/functor_list.h \
                         math/vector.h \
+                        math/quaternion.h \
                         math/vector2D.h \
                         math/matrix.h \
Index: /trunk/src/lib/coord/p_node.cc
===================================================================
--- /trunk/src/lib/coord/p_node.cc	(revision 6615)
+++ /trunk/src/lib/coord/p_node.cc	(revision 6616)
@@ -214,4 +214,5 @@
 
   *this->toCoordinate = relCoordSoft;
+  this->toStep = 0.0f;
   this->bias = bias;
 }
@@ -299,4 +300,5 @@
       *this->toCoordinate = absCoordSoft;
   }
+  this->toStep = 0.0f;
 }
 
@@ -370,4 +372,5 @@
   *this->toDirection = relDirSoft;
   this->bias = bias;
+  this->toStep = 0.0f;
   this->bRelDirChanged = true;
 }
@@ -439,4 +442,5 @@
 
   this->bias = bias;
+  this->toStep = 0.0f;
   this->bRelDirChanged = true;
 }
@@ -614,5 +618,5 @@
   }
   this->bias = bias;
-
+  this->toStep = 0.0f;
 
   Vector tmpV = this->getAbsCoor();
@@ -743,5 +747,7 @@
         if (unlikely(this->toDirection != NULL))
         {
-          Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, fabsf(dt)*this->bias);
+          this->toStep += fabs(dt) * bias;
+          printf("%s::%s %f\n", this->getClassName(), this->getName(), this->toStep );
+          Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, toStep);
           if (this->relDirection.distance(rotQuat) >PNODE_ITERATION_DELTA)
           {
Index: /trunk/src/lib/coord/p_node.h
===================================================================
--- /trunk/src/lib/coord/p_node.h	(revision 6615)
+++ /trunk/src/lib/coord/p_node.h	(revision 6616)
@@ -24,4 +24,5 @@
 
 #include "vector.h"
+#include "quaternion.h"
 #include <list>
 
@@ -218,4 +219,5 @@
   Quaternion*        toDirection;        //!< a direction to which to iterate. (This is used in conjunction with setParentSoft and set*DirSoft)
   float              bias;               //!< how fast to iterate to the given position (default is 1)
+  float              toStep;
 
   PNode*             parent;             //!< a pointer to the parent node.
Index: /trunk/src/lib/math/curve.h
===================================================================
--- /trunk/src/lib/math/curve.h	(revision 6615)
+++ /trunk/src/lib/math/curve.h	(revision 6616)
@@ -11,4 +11,5 @@
 
 #include "vector.h"
+#include "quaternion.h"
 
 template<class T> class tList;
Index: /trunk/src/lib/math/quaternion.cc
===================================================================
--- /trunk/src/lib/math/quaternion.cc	(revision 6616)
+++ /trunk/src/lib/math/quaternion.cc	(revision 6616)
@@ -0,0 +1,238 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christian Meyer
+   co-programmer: Patrick Boenzli : Vector::scale()
+                                    Vector::abs()
+
+   Quaternion code borrowed from an Gamasutra article by Nick Bobick and Ken Shoemake
+
+   2005-06-02: Benjamin Grauer: speed up, and new Functionality to Vector (mostly inline now)
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MATH
+
+#include "quaternion.h"
+#ifdef DEBUG
+  #include "debug.h"
+#else
+  #include <stdio.h>
+  #define PRINT(x) printf
+#endif
+
+using namespace std;
+
+/////////////////
+/* QUATERNIONS */
+/////////////////
+/**
+ *  calculates a lookAt rotation
+ * @param dir: the direction you want to look
+ * @param up: specify what direction up should be
+
+   Mathematically this determines the rotation a (0,0,1)-Vector has to undergo to point
+   the same way as dir. If you want to use this with cameras, you'll have to reverse the
+   dir Vector (Vector(0,0,0) - your viewing direction) or you'll point the wrong way. You
+   can use this for meshes as well (then you do not have to reverse the vector), but keep
+   in mind that if you do that, the model's front has to point in +z direction, and left
+   and right should be -x or +x respectively or the mesh wont rotate correctly.
+ *
+ * @TODO !!! OPTIMIZE THIS !!!
+ */
+Quaternion::Quaternion (const Vector& dir, const Vector& up)
+{
+  Vector z = dir.getNormalized();
+  Vector x = up.cross(z).getNormalized();
+  Vector y = z.cross(x);
+
+  float m[4][4];
+  m[0][0] = x.x;
+  m[0][1] = x.y;
+  m[0][2] = x.z;
+  m[0][3] = 0;
+  m[1][0] = y.x;
+  m[1][1] = y.y;
+  m[1][2] = y.z;
+  m[1][3] = 0;
+  m[2][0] = z.x;
+  m[2][1] = z.y;
+  m[2][2] = z.z;
+  m[2][3] = 0;
+  m[3][0] = 0;
+  m[3][1] = 0;
+  m[3][2] = 0;
+  m[3][3] = 1;
+
+  *this = Quaternion (m);
+}
+
+/**
+ *  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;
+}
+
+/**
+ *  convert the Quaternion to a 4x4 rotational glMatrix
+ * @param m: a buffer to store the Matrix in
+ */
+void Quaternion::matrix (float m[4][4]) const
+{
+  float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2;
+
+  // calculate coefficients
+  x2 = v.x + v.x;
+  y2 = v.y + v.y;
+  z2 = v.z + v.z;
+  xx = v.x * x2; xy = v.x * y2; xz = v.x * z2;
+  yy = v.y * y2; yz = v.y * z2; zz = v.z * z2;
+  wx = w * x2; wy = w * y2; wz = w * z2;
+
+  m[0][0] = 1.0 - (yy + zz); m[1][0] = xy - wz;
+  m[2][0] = xz + wy; m[3][0] = 0.0;
+
+  m[0][1] = xy + wz; m[1][1] = 1.0 - (xx + zz);
+  m[2][1] = yz - wx; m[3][1] = 0.0;
+
+  m[0][2] = xz - wy; m[1][2] = yz + wx;
+  m[2][2] = 1.0 - (xx + yy); m[3][2] = 0.0;
+
+  m[0][3] = 0; m[1][3] = 0;
+  m[2][3] = 0; m[3][3] = 1;
+}
+
+/**
+ *  performs a smooth move.
+ * @param from  where
+ * @param to where
+ * @param t the time this transformation should take value [0..1]
+ * @returns the Result of the smooth move
+ */
+Quaternion Quaternion::quatSlerp(const Quaternion& from, const Quaternion& to, float t)
+{
+  float tol[4];
+  double omega, cosom, sinom, scale0, scale1;
+  //  float DELTA = 0.2;
+
+  cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w;
+
+  if( cosom < 0.0 )
+    {
+      cosom = -cosom;
+      tol[0] = -to.v.x;
+      tol[1] = -to.v.y;
+      tol[2] = -to.v.z;
+      tol[3] = -to.w;
+    }
+  else
+    {
+      tol[0] = to.v.x;
+      tol[1] = to.v.y;
+      tol[2] = to.v.z;
+      tol[3] = to.w;
+    }
+
+  omega = acos(cosom);
+  sinom = sin(omega);
+  scale0 = sin((1.0 - t) * omega) / sinom;
+  scale1 = sin(t * omega) / sinom;
+  return Quaternion(Vector(scale0 * from.v.x + scale1 * tol[0],
+                    scale0 * from.v.y + scale1 * tol[1],
+                    scale0 * from.v.z + scale1 * tol[2]),
+                    scale0 * from.w + scale1 * tol[3]);
+}
+
+
+/**
+ *  convert a rotational 4x4 glMatrix into a Quaternion
+ * @param m: a 4x4 matrix in glMatrix order
+ */
+Quaternion::Quaternion (float m[4][4])
+{
+
+  float  tr, s, q[4];
+  int    i, j, k;
+
+  int nxt[3] = {1, 2, 0};
+
+  tr = m[0][0] + m[1][1] + m[2][2];
+
+        // check the diagonal
+  if (tr > 0.0)
+  {
+    s = sqrt (tr + 1.0);
+    w = s / 2.0;
+    s = 0.5 / s;
+    v.x = (m[1][2] - m[2][1]) * s;
+    v.y = (m[2][0] - m[0][2]) * s;
+    v.z = (m[0][1] - m[1][0]) * s;
+        }
+        else
+        {
+                // diagonal is negative
+        i = 0;
+        if (m[1][1] > m[0][0]) i = 1;
+    if (m[2][2] > m[i][i]) i = 2;
+    j = nxt[i];
+    k = nxt[j];
+
+    s = sqrt ((m[i][i] - (m[j][j] + m[k][k])) + 1.0);
+
+    q[i] = s * 0.5;
+
+    if (s != 0.0) s = 0.5 / s;
+
+          q[3] = (m[j][k] - m[k][j]) * s;
+    q[j] = (m[i][j] + m[j][i]) * s;
+    q[k] = (m[i][k] + m[k][i]) * s;
+
+        v.x = q[0];
+        v.y = q[1];
+        v.z = q[2];
+        w = q[3];
+  }
+}
+
+/**
+ *  outputs some nice formated debug information about this quaternion
+*/
+void Quaternion::debug()
+{
+  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
+}
+
+void Quaternion::debug2()
+{
+  Vector axis = this->getSpacialAxis();
+  PRINT(0)("angle = %f, axis: ax=%f, ay=%f, az=%f\n", this->getSpacialAxisAngle(), axis.x, axis.y, axis.z );
+}
Index: /trunk/src/lib/math/quaternion.h
===================================================================
--- /trunk/src/lib/math/quaternion.h	(revision 6616)
+++ /trunk/src/lib/math/quaternion.h	(revision 6616)
@@ -0,0 +1,116 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Christian Meyer
+   co-programmer: ...
+*/
+
+/*!
+ * @file quaternion.h
+ * A basic 3D quaternion math framework
+ *
+ * Contains classes to handle vectors, lines, rotations and planes
+*/
+
+#ifndef __QUATERNION_H_
+#define __QUATERNION_H_
+
+#include <math.h>
+#include "compiler.h"
+//! PI the circle-constant
+#define PI 3.14159265359f
+#include "vector.h"
+
+//! Quaternion
+/**
+   Class to handle 3-dimensional rotation efficiently
+*/
+class Quaternion
+{
+ public:
+  /** creates a Default quaternion (multiplicational identity Quaternion)*/
+  inline Quaternion () { w = 1; v = Vector(0,0,0); }
+  /** 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]);
+  /** 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);
+
+  /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
+  inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
+  /** @param f: a real value @return a Quaternion containing the quotient */
+  inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); };
+  /** @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;}
+  /** @param f: a real value @return a Quaternion containing the product */
+  inline Quaternion operator* (const float& f) const { return Quaternion(this->v*f, this->w*f); };
+  /** @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;}
+  /** @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 operator* (const Quaternion& q) const { return Quaternion(Vector(this->w*q.v.x + this->v.x*q.w + this->v.y*q.v.z - this->v.z*q.v.y,
+                                                                         this->w*q.v.y + this->v.y*q.w + this->v.z*q.v.x - this->v.x*q.v.z,
+                                                                         this->w*q.v.z + this->v.z*q.w + this->v.x*q.v.y - this->v.y*q.v.x),
+                                                                         this->w*q.w - this->v.x*q.v.x - this->v.y*q.v.y - this->v.z*q.v.z); };
+  /** @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 by which to devide @returns the division from this by q (this / q) */
+  inline Quaternion operator/ (const Quaternion& q) const { return *this * q.inverse(); };
+  /** @param q the Quaternion by which to devide @returns the division from this by q (this /= q) */
+  inline const Quaternion& operator/= (const Quaternion& q) { *this = *this * q.inverse(); 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); }
+  /** @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; };
+  /** 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;}
+  /** conjugates this Quaternion @returns the conjugate */
+  inline Quaternion conjugate () const { return Quaternion(Vector(-v.x, -v.y, -v.z), this->w); };
+  /** @returns the norm of The Quaternion */
+  inline float norm () const { return sqrt(w*w + v.x*v.x + v.y*v.y + v.z*v.z); };
+  /** @returns the inverted Quaterntion of this */
+  inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); };
+  /** @returns the dot Product of a Quaternion */
+  inline float dot (const Quaternion& q) const { return v.x*q.v.x + v.y*q.v.y + v.z*q.v.z + w*q.w; };
+  /** @retuns the Distance between two Quaternions */
+  inline float distance(const Quaternion& q) const { return 2*acos(fabsf(this->dot(q))); };
+  /** @param v: the Vector  @return a new Vector representing v rotated by the Quaternion */
+  inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; };
+  void matrix (float m[4][4]) const;
+  /** @returns the normalized Quaternion (|this|) */
+  inline Quaternion getNormalized() const { float n = this->norm(); return Quaternion(this->v/n, this->w/n); };
+  /** normalizes the current Quaternion */
+  inline void normalize() { float n = this->norm(); this->v /= n; this->w/=n; };
+
+  /** @returns the rotational axis of this Quaternion */
+  inline Vector getSpacialAxis() const { return this->v / sin(acos(w));/*sqrt(v.x*v.x + v.y*v.y + v.z+v.z);*/ };
+  /** @returns the rotational angle of this Quaternion around getSpacialAxis()  !! IN DEGREE !! */
+  inline float getSpacialAxisAngle() const { return 360.0 / M_PI * acos( this->w ); };
+
+  static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
+
+  void debug();
+  void debug2();
+
+
+ public:
+  Vector    v;        //!< Imaginary Vector
+  float     w;        //!< Real part of the number
+};
+
+
+#endif /* __QUATERNION_H_ */
+
Index: /trunk/src/lib/math/vector.cc
===================================================================
--- /trunk/src/lib/math/vector.cc	(revision 6615)
+++ /trunk/src/lib/math/vector.cc	(revision 6616)
@@ -66,211 +66,4 @@
   PRINT(0)(" lenght: %f", len());
   PRINT(0)("\n");
-}
-
-/////////////////
-/* QUATERNIONS */
-/////////////////
-/**
- *  calculates a lookAt rotation
- * @param dir: the direction you want to look
- * @param up: specify what direction up should be
-
-   Mathematically this determines the rotation a (0,0,1)-Vector has to undergo to point
-   the same way as dir. If you want to use this with cameras, you'll have to reverse the
-   dir Vector (Vector(0,0,0) - your viewing direction) or you'll point the wrong way. You
-   can use this for meshes as well (then you do not have to reverse the vector), but keep
-   in mind that if you do that, the model's front has to point in +z direction, and left
-   and right should be -x or +x respectively or the mesh wont rotate correctly.
- *
- * @TODO !!! OPTIMIZE THIS !!!
- */
-Quaternion::Quaternion (const Vector& dir, const Vector& up)
-{
-  Vector z = dir.getNormalized();
-  Vector x = up.cross(z).getNormalized();
-  Vector y = z.cross(x);
-
-  float m[4][4];
-  m[0][0] = x.x;
-  m[0][1] = x.y;
-  m[0][2] = x.z;
-  m[0][3] = 0;
-  m[1][0] = y.x;
-  m[1][1] = y.y;
-  m[1][2] = y.z;
-  m[1][3] = 0;
-  m[2][0] = z.x;
-  m[2][1] = z.y;
-  m[2][2] = z.z;
-  m[2][3] = 0;
-  m[3][0] = 0;
-  m[3][1] = 0;
-  m[3][2] = 0;
-  m[3][3] = 1;
-
-  *this = Quaternion (m);
-}
-
-/**
- *  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;
-}
-
-/**
- *  convert the Quaternion to a 4x4 rotational glMatrix
- * @param m: a buffer to store the Matrix in
- */
-void Quaternion::matrix (float m[4][4]) const
-{
-  float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2;
-
-  // calculate coefficients
-  x2 = v.x + v.x;
-  y2 = v.y + v.y;
-  z2 = v.z + v.z;
-  xx = v.x * x2; xy = v.x * y2; xz = v.x * z2;
-  yy = v.y * y2; yz = v.y * z2; zz = v.z * z2;
-  wx = w * x2; wy = w * y2; wz = w * z2;
-
-  m[0][0] = 1.0 - (yy + zz); m[1][0] = xy - wz;
-  m[2][0] = xz + wy; m[3][0] = 0.0;
-
-  m[0][1] = xy + wz; m[1][1] = 1.0 - (xx + zz);
-  m[2][1] = yz - wx; m[3][1] = 0.0;
-
-  m[0][2] = xz - wy; m[1][2] = yz + wx;
-  m[2][2] = 1.0 - (xx + yy); m[3][2] = 0.0;
-
-  m[0][3] = 0; m[1][3] = 0;
-  m[2][3] = 0; m[3][3] = 1;
-}
-
-/**
- *  performs a smooth move.
- * @param from  where
- * @param to where
- * @param t the time this transformation should take value [0..1]
- * @returns the Result of the smooth move
- */
-Quaternion Quaternion::quatSlerp(const Quaternion& from, const Quaternion& to, float t)
-{
-  float tol[4];
-  double omega, cosom, sinom, scale0, scale1;
-  //  float DELTA = 0.2;
-
-  cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w;
-
-  if( cosom < 0.0 )
-    {
-      cosom = -cosom;
-      tol[0] = -to.v.x;
-      tol[1] = -to.v.y;
-      tol[2] = -to.v.z;
-      tol[3] = -to.w;
-    }
-  else
-    {
-      tol[0] = to.v.x;
-      tol[1] = to.v.y;
-      tol[2] = to.v.z;
-      tol[3] = to.w;
-    }
-
-  omega = acos(cosom);
-  sinom = sin(omega);
-  scale0 = sin((1.0 - t) * omega) / sinom;
-  scale1 = sin(t * omega) / sinom;
-  return Quaternion(Vector(scale0 * from.v.x + scale1 * tol[0],
-                    scale0 * from.v.y + scale1 * tol[1],
-                    scale0 * from.v.z + scale1 * tol[2]),
-                    scale0 * from.w + scale1 * tol[3]);
-}
-
-
-/**
- *  convert a rotational 4x4 glMatrix into a Quaternion
- * @param m: a 4x4 matrix in glMatrix order
- */
-Quaternion::Quaternion (float m[4][4])
-{
-
-  float  tr, s, q[4];
-  int    i, j, k;
-
-  int nxt[3] = {1, 2, 0};
-
-  tr = m[0][0] + m[1][1] + m[2][2];
-
-        // check the diagonal
-  if (tr > 0.0)
-  {
-    s = sqrt (tr + 1.0);
-    w = s / 2.0;
-    s = 0.5 / s;
-    v.x = (m[1][2] - m[2][1]) * s;
-    v.y = (m[2][0] - m[0][2]) * s;
-    v.z = (m[0][1] - m[1][0]) * s;
-        }
-        else
-        {
-                // diagonal is negative
-        i = 0;
-        if (m[1][1] > m[0][0]) i = 1;
-    if (m[2][2] > m[i][i]) i = 2;
-    j = nxt[i];
-    k = nxt[j];
-
-    s = sqrt ((m[i][i] - (m[j][j] + m[k][k])) + 1.0);
-
-    q[i] = s * 0.5;
-
-    if (s != 0.0) s = 0.5 / s;
-
-          q[3] = (m[j][k] - m[k][j]) * s;
-    q[j] = (m[i][j] + m[j][i]) * s;
-    q[k] = (m[i][k] + m[k][i]) * s;
-
-        v.x = q[0];
-        v.y = q[1];
-        v.z = q[2];
-        w = q[3];
-  }
-}
-
-/**
- *  outputs some nice formated debug information about this quaternion
-*/
-void Quaternion::debug()
-{
-  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
-}
-
-void Quaternion::debug2()
-{
-  Vector axis = this->getSpacialAxis();
-  PRINT(0)("angle = %f, axis: ax=%f, ay=%f, az=%f\n", this->getSpacialAxisAngle(), axis.x, axis.y, axis.z );
 }
 
Index: /trunk/src/lib/math/vector.h
===================================================================
--- /trunk/src/lib/math/vector.h	(revision 6615)
+++ /trunk/src/lib/math/vector.h	(revision 6616)
@@ -125,90 +125,4 @@
 
 
-//! Quaternion
-/**
-   Class to handle 3-dimensional rotation efficiently
-*/
-class Quaternion
-{
- public:
-  /** creates a Default quaternion (multiplicational identity Quaternion)*/
-  inline Quaternion () { w = 1; v = Vector(0,0,0); }
-  /** 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]);
-  /** 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);
-
-  /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
-  inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
-  /** @param f: a real value @return a Quaternion containing the quotient */
-  inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); };
-  /** @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;}
-  /** @param f: a real value @return a Quaternion containing the product */
-  inline Quaternion operator* (const float& f) const { return Quaternion(this->v*f, this->w*f); };
-  /** @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;}
-  /** @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 operator* (const Quaternion& q) const { return Quaternion(Vector(this->w*q.v.x + this->v.x*q.w + this->v.y*q.v.z - this->v.z*q.v.y,
-                                                                         this->w*q.v.y + this->v.y*q.w + this->v.z*q.v.x - this->v.x*q.v.z,
-                                                                         this->w*q.v.z + this->v.z*q.w + this->v.x*q.v.y - this->v.y*q.v.x),
-                                                                         this->w*q.w - this->v.x*q.v.x - this->v.y*q.v.y - this->v.z*q.v.z); };
-  /** @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 by which to devide @returns the division from this by q (this / q) */
-  inline Quaternion operator/ (const Quaternion& q) const { return *this * q.inverse(); };
-  /** @param q the Quaternion by which to devide @returns the division from this by q (this /= q) */
-  inline const Quaternion& operator/= (const Quaternion& q) { *this = *this * q.inverse(); 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); }
-  /** @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; };
-  /** 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;}
-  /** conjugates this Quaternion @returns the conjugate */
-  inline Quaternion conjugate () const { return Quaternion(Vector(-v.x, -v.y, -v.z), this->w); };
-  /** @returns the norm of The Quaternion */
-  inline float norm () const { return sqrt(w*w + v.x*v.x + v.y*v.y + v.z*v.z); };
-  /** @returns the inverted Quaterntion of this */
-  inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); };
-  /** @returns the dot Product of a Quaternion */
-  inline float dot (const Quaternion& q) const { return v.x*q.v.x + v.y*q.v.y + v.z*q.v.z + w*q.w; };
-  /** @retuns the Distance between two Quaternions */
-  inline float distance(const Quaternion& q) const { return 2*acos(fabsf(this->dot(q))); };
-  /** @param v: the Vector  @return a new Vector representing v rotated by the Quaternion */
-  inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; };
-  void matrix (float m[4][4]) const;
-  /** @returns the normalized Quaternion (|this|) */
-  inline Quaternion getNormalized() const { float n = this->norm(); return Quaternion(this->v/n, this->w/n); };
-  /** normalizes the current Quaternion */
-  inline void normalize() { float n = this->norm(); this->v /= n; this->w/=n; };
-
-  /** @returns the rotational axis of this Quaternion */
-  inline Vector getSpacialAxis() const { return this->v / sin(acos(w));/*sqrt(v.x*v.x + v.y*v.y + v.z+v.z);*/ };
-  /** @returns the rotational angle of this Quaternion around getSpacialAxis()  !! IN DEGREE !! */
-  inline float getSpacialAxisAngle() const { return 360.0 / M_PI * acos( this->w ); };
-
-  static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
-
-  void debug();
-  void debug2();
-
-
- public:
-  Vector    v;        //!< Imaginary Vector
-  float     w;        //!< Real part of the number
-
-};
-
-
-
-
 //! 3D rotation (OBSOLETE)
 /**
Index: /trunk/src/lib/math/vector2D.h
===================================================================
--- /trunk/src/lib/math/vector2D.h	(revision 6615)
+++ /trunk/src/lib/math/vector2D.h	(revision 6616)
@@ -10,11 +10,11 @@
 
 ### File Specific:
-   main-programmer: Christian Meyer
+   main-programmer: Benjamin Grauer
    co-programmer: ...
 */
 
 /*!
- * @file vector.h
- * A basic 3D math framework
+ * @file vector2D.h
+ * A basic 2D Vector math framework
  *
  * Contains classes to handle vectors, lines, rotations and planes
Index: /trunk/src/lib/physics/physics_interface.h
===================================================================
--- /trunk/src/lib/physics/physics_interface.h	(revision 6615)
+++ /trunk/src/lib/physics/physics_interface.h	(revision 6616)
@@ -10,5 +10,5 @@
 
 #include "vector.h"
-
+#include "quaternion.h"
 #ifndef NULL
 #define NULL 0          //!< NULL
Index: /trunk/src/util/animation/animation3d.h
===================================================================
--- /trunk/src/util/animation/animation3d.h	(revision 6615)
+++ /trunk/src/util/animation/animation3d.h	(revision 6616)
@@ -7,4 +7,5 @@
 
 #include "vector.h"
+#include "quaternion.h"
 class PNode;
 
