Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 3606)
+++ orxonox/trunk/src/Makefile.am	(revision 3607)
@@ -112,4 +112,6 @@
 		 lib/util/ini_parser.h \
 		 lib/math/vector.h \
+		 lib/math/vector_new.h \
+		 lib/math/quaternion.h \
 		 lib/math/curve.h \
 		 glmenu/glmenu_imagescreen.h 
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3606)
+++ orxonox/trunk/src/Makefile.in	(revision 3607)
@@ -313,4 +313,6 @@
 		 lib/util/ini_parser.h \
 		 lib/math/vector.h \
+		 lib/math/vector_new.h \
+		 lib/math/quaternion.h \
 		 lib/math/curve.h \
 		 glmenu/glmenu_imagescreen.h 
Index: orxonox/trunk/src/camera.cc
===================================================================
--- orxonox/trunk/src/camera.cc	(revision 3606)
+++ orxonox/trunk/src/camera.cc	(revision 3607)
@@ -240,6 +240,7 @@
 
   // ===== second camera control calculation option
-  
-  gluLookAt(this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z, 
+
+  Vector r = this->getAbsCoor();
+  gluLookAt(r.x, r.y, r.z, 
 	    this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z,
 	    0.0, 1.0, 0.0);
Index: orxonox/trunk/src/defs/stdincl.h
===================================================================
--- orxonox/trunk/src/defs/stdincl.h	(revision 3606)
+++ orxonox/trunk/src/defs/stdincl.h	(revision 3607)
@@ -11,4 +11,5 @@
 #define null 0   //!< null
 
+
 typedef unsigned char byte;
 
@@ -22,4 +23,5 @@
 #endif
 
+#include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
Index: orxonox/trunk/src/lib/coord/helper_parent.h
===================================================================
--- orxonox/trunk/src/lib/coord/helper_parent.h	(revision 3606)
+++ orxonox/trunk/src/lib/coord/helper_parent.h	(revision 3607)
@@ -8,5 +8,5 @@
 #define _HELPER_PARENT_H
 
-#include "stdincl.h"
+
 #include "p_node.h"
 
Index: orxonox/trunk/src/lib/coord/null_parent.cc
===================================================================
--- orxonox/trunk/src/lib/coord/null_parent.cc	(revision 3606)
+++ orxonox/trunk/src/lib/coord/null_parent.cc	(revision 3607)
@@ -19,4 +19,5 @@
 
 #include "null_parent.h"
+#include "stdincl.h"
 
 
@@ -51,5 +52,5 @@
   this->parent = this;
   this->mode = PNODE_ALL;
-  this->absCoordinate = *absCoordinate;
+  *this->absCoordinate = *absCoordinate;
   this->setName("NullParent");
 }
@@ -77,7 +78,7 @@
 {
 
-  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
-  this->absCoordinate = this->relCoordinate;
-  this->absDirection = parent->getAbsDir () * this->relDirection;
+  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
+  *this->absCoordinate = *this->relCoordinate;
+  *this->absDirection = parent->getAbsDir () * *this->relDirection;
   
   PNode* pn = this->children->enumerate ();
Index: orxonox/trunk/src/lib/coord/null_parent.h
===================================================================
--- orxonox/trunk/src/lib/coord/null_parent.h	(revision 3606)
+++ orxonox/trunk/src/lib/coord/null_parent.h	(revision 3607)
@@ -8,5 +8,5 @@
 #define _NULL_PARENT_H
 
-#include "stdincl.h"
+
 #include "p_node.h"
 
Index: orxonox/trunk/src/lib/coord/p_node.cc
===================================================================
--- orxonox/trunk/src/lib/coord/p_node.cc	(revision 3606)
+++ orxonox/trunk/src/lib/coord/p_node.cc	(revision 3607)
@@ -21,7 +21,9 @@
 
 #include "p_node.h"
+#include "stdincl.h"
 
 #include "null_parent.h"
-#include "vector.h"
+//#include "vector.h"
+//#include "quaternion.h"
 
 using namespace std;
@@ -51,12 +53,12 @@
   this->init(parent);
 
-  this->absCoordinate = *absCoordinate;
+  *this->absCoordinate = *absCoordinate;
   if (parent != NULL)
     {
-      this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+      *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
       parent->addChild (this);
     }
   else 
-    this->relCoordinate = Vector(0,0,0);
+    this->relCoordinate = new Vector(0,0,0);
 }
 
@@ -92,4 +94,5 @@
 }
 
+
 void PNode::init(PNode* parent)
 {
@@ -101,4 +104,9 @@
   this->parent = parent; 
   this->objectName = NULL;
+
+  this->absCoordinate = new Vector();
+  this->relCoordinate = new Vector();
+  this->absDirection = new Quaternion();
+  this->relDirection = new Quaternion();
 }
 
@@ -130,5 +138,5 @@
 Vector PNode::getRelCoor ()
 {
-  Vector r = this->relCoordinate; /* return a copy, so it can't be modified */
+  Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */
   return r;
 }
@@ -146,5 +154,5 @@
 {
   this->bRelCoorChanged = true;
-  this->relCoordinate = *relCoord;
+  *this->relCoordinate = *relCoord;
 }
 
@@ -156,5 +164,5 @@
 Vector PNode::getAbsCoor ()
 {
-  return this->absCoordinate;
+  return *this->absCoordinate;
 }
 
@@ -170,5 +178,5 @@
 {
   this->bAbsCoorChanged = true;
-  this->absCoordinate = *absCoord;
+  *this->absCoordinate = *absCoord;
 }
 
@@ -198,9 +206,9 @@
   if( this->bAbsCoorChanged)
     {
-      this->absCoordinate = this->absCoordinate + *shift;
+      *this->absCoordinate = *this->absCoordinate + *shift;
     }
   else 
     {
-      this->relCoordinate = this->relCoordinate + *shift;
+      *this->relCoordinate = *this->relCoordinate + *shift;
       this->bRelCoorChanged = true;
     }
@@ -215,5 +223,5 @@
 Quaternion PNode::getRelDir ()
 {
-  return this->relDirection;
+  return *this->relDirection;
 }
 
@@ -230,5 +238,5 @@
 {
   this->bRelCoorChanged = true;
-  this->relDirection = *relDir;
+  *this->relDirection = *relDir;
 }
 
@@ -240,5 +248,5 @@
 Quaternion PNode::getAbsDir ()
 {
-  return this->absDirection;
+  return *this->absDirection;
 }
 
@@ -255,5 +263,5 @@
 {
   this->bAbsDirChanged = true;
-  this->absDirection = *absDir;
+  *this->absDirection = *absDir;
 }
 
@@ -410,5 +418,5 @@
 void PNode::update ()
 {
-  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
+  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
   // printf("%s", this->objectName);
   if(this->mode & PNODE_MOVEMENT )
@@ -417,5 +425,5 @@
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
-	  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+	  *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
 	}
       else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
@@ -424,8 +432,8 @@
 	  if( this->parent == NULL)
 	    {
-	      this->absCoordinate = this->relCoordinate;
+	      *this->absCoordinate = *this->relCoordinate;
 	    }
 	  else
-	    this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;	      /* update the current absCoordinate */
+	    *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate;	      /* update the current absCoordinate */
 	}
     }
@@ -436,10 +444,10 @@
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
-	  this->relDirection = this->absDirection - parent->getAbsDir();
+	  *this->relDirection = *this->absDirection - parent->getAbsDir();
 	}
       else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
 	  /* update the current absDirection - remember * means rotation around sth.*/
-	  this->absDirection = parent->getAbsDir() * this->relDirection;
+	  *this->absDirection = parent->getAbsDir() * *this->relDirection;
 	}
     }
@@ -450,5 +458,5 @@
 	{
 	  /* if you have set the absolute coordinates this overrides all other changes */
-	  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+	  *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
 	}
       else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
@@ -456,7 +464,7 @@
 	  /*this is bad style... must be deleted later - just for testing*/
 	  if( this->parent == NULL)
-	    this->absCoordinate = this->relCoordinate;
+	    *this->absCoordinate = *this->relCoordinate;
 	  else
-	    this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);	      /* update the current absCoordinate */
+	    *this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(*this->relCoordinate);	      /* update the current absCoordinate */
 	}
     }
@@ -505,7 +513,7 @@
 {
   PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n", 
-	 this->absCoordinate.x, 
-	 this->absCoordinate.y,
-	 this->absCoordinate.z);
+	 this->absCoordinate->x, 
+	 this->absCoordinate->y,
+	 this->absCoordinate->z);
 }
 
Index: orxonox/trunk/src/lib/coord/p_node.h
===================================================================
--- orxonox/trunk/src/lib/coord/p_node.h	(revision 3606)
+++ orxonox/trunk/src/lib/coord/p_node.h	(revision 3607)
@@ -23,4 +23,5 @@
 
 #include "base_object.h"
+#include "vector.h"
 
 // FORWARD DEFINITION \\
@@ -28,4 +29,5 @@
 class Quaternion;
 class Vector;
+template<class T> class tList;
 
 //! enumeration for the different translation-binding-types
@@ -102,8 +104,8 @@
   bool bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
 
-  Vector relCoordinate;    //!< coordinates relative to the parent
-  Vector absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
-  Quaternion relDirection; //!< direction relative to the parent
-  Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
+  Vector* relCoordinate;    //!< coordinates relative to the parent
+  Vector* absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
+  Quaternion* relDirection; //!< direction relative to the parent
+  Quaternion* absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
 
   int mode;                //!< the mode of the binding
Index: orxonox/trunk/src/lib/lang/base_object.cc
===================================================================
--- orxonox/trunk/src/lib/lang/base_object.cc	(revision 3606)
+++ orxonox/trunk/src/lib/lang/base_object.cc	(revision 3607)
@@ -18,4 +18,5 @@
 
 #include "base_object.h"
+#include "stdincl.h"
 
 
Index: orxonox/trunk/src/lib/lang/base_object.h
===================================================================
--- orxonox/trunk/src/lib/lang/base_object.h	(revision 3606)
+++ orxonox/trunk/src/lib/lang/base_object.h	(revision 3607)
@@ -8,5 +8,5 @@
 #define _BASE_OBJECT_H
 
-#include "stdincl.h"
+//#include "stdincl.h"
 
 
Index: orxonox/trunk/src/lib/math/quaternion.h
===================================================================
--- orxonox/trunk/src/lib/math/quaternion.h	(revision 3607)
+++ orxonox/trunk/src/lib/math/quaternion.h	(revision 3607)
@@ -0,0 +1,413 @@
+/*! 
+    \file vector.h
+    \brief A basic 3D math framework
+    
+    Contains classes to handle vectors, lines, rotations and planes
+*/ 
+
+#ifndef _QUATERNION_H
+#define _QUATERNION_H
+
+#include <math.h>
+//! PI the circle-constant
+
+//! Quaternion
+/**
+	Class to handle 3-dimensional rotation efficiently
+*/
+class Quaternion
+{
+ public:
+  Vector v;	//!< Imaginary Vector
+  float w;        //!< Real part of the number
+  
+  Quaternion ();
+  Quaternion (float m[4][4]);
+  Quaternion (float angle, const Vector& axis);
+  Quaternion (const Vector& dir, const Vector& up);
+  Quaternion (float roll, float pitch, float yaw);
+  
+  Quaternion operator/ (const float& f) const;
+  Quaternion operator* (const float& f) const;
+  Quaternion operator* (const Quaternion& q) const;
+  Quaternion operator+ (const Quaternion& q) const;
+  Quaternion operator- (const Quaternion& q) const;
+  Quaternion conjugate () const;
+  Quaternion inverse () const;
+  Vector apply (Vector& f) const;
+  float norm () const;
+  void matrix (float m[4][4]) const;
+  void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
+  
+  void debug();
+ private:
+  float DELTA;      //!< resolution of calculation
+
+};
+
+
+/**
+	\brief creates a multiplicational identity Quaternion
+*/
+Quaternion::Quaternion ()
+{
+	w = 1;
+	v = Vector(0,0,0);
+}
+
+/**
+	\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)
+{
+	w = cos(angle/2);
+	v = axis * sin(angle/2);
+}
+
+/**
+   \brief 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.
+*/
+Quaternion::Quaternion (const Vector& dir, const Vector& up)
+{
+  Vector z = dir;
+  z.normalize(); 
+  Vector x = up.cross(z);
+  x.normalize(); 
+  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);
+}
+
+/**
+	\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.
+*/
+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))
+*/
+Quaternion Quaternion::operator*(const Quaternion& q) const
+{
+	float A, B, C, D, E, F, G, H;
+	Quaternion r;
+	
+	A = (w   + v.x)*(q.w   + q.v.x);
+	B = (v.z - v.y)*(q.v.y - q.v.z);
+	C = (w   - v.x)*(q.v.y + q.v.z); 
+	D = (v.y + v.z)*(q.w   - q.v.x);
+	E = (v.x + v.z)*(q.v.x + q.v.y);
+	F = (v.x - v.z)*(q.v.x - q.v.y);
+	G = (w   + v.y)*(q.w   - q.v.z);
+	H = (w   - v.y)*(q.w   + q.v.z);
+	
+	r.w = B +  (-E - F + G + H)/2;
+	r.v.x = A - (E + F + G + H)/2; 
+	r.v.y = C + (E - F + G - H)/2; 
+	r.v.z = D + (E - F - G + H)/2;
+	
+	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;
+}
+
+/**
+	\brief rotate a Vector by a Quaternion
+	\param v: the Vector
+	\return a new Vector representing v rotated by the Quaternion
+*/
+Vector Quaternion::apply (Vector& v) const
+{
+	Quaternion q;
+	q.v = v;
+	q.w = 0;
+	q = *this * q * conjugate();
+	return q.v;
+}
+
+/**
+	\brief multiply a Quaternion with a real value
+	\param f: a real value
+	\return a new Quaternion containing the product
+*/
+Quaternion Quaternion::operator*(const float& f) const
+{
+	Quaternion r(*this);
+	r.w = r.w*f;
+	r.v = r.v*f;
+	return r;
+}
+
+/**
+	\brief divide a Quaternion by a real value
+	\param f: a real value
+	\return a new Quaternion containing the quotient
+*/
+Quaternion Quaternion::operator/(const float& f) const
+{
+	if( f == 0) return Quaternion();
+	Quaternion r(*this);
+	r.w = r.w/f;
+	r.v = r.v/f;
+	return r;
+}
+
+/**
+	\brief calculate the conjugate value of the Quaternion
+	\return the conjugate Quaternion
+*/
+Quaternion Quaternion::conjugate() const
+{
+	Quaternion r(*this);
+	r.v = Vector() - r.v;
+	return r;
+}
+
+/**
+	\brief calculate the norm of the Quaternion
+	\return the norm of The Quaternion
+*/
+float Quaternion::norm() const
+{
+	return w*w + v.x*v.x + v.y*v.y + v.z*v.z;
+}
+
+/**
+	\brief calculate the inverse value of the Quaternion
+	\return the inverse Quaternion
+	
+	Note that this is equal to conjugate() if the Quaternion's norm is 1
+*/
+Quaternion Quaternion::inverse() const
+{
+	float n = norm();
+	if (n != 0)
+	{
+		return conjugate() / norm();
+	}
+	else return Quaternion();
+}
+
+/**
+	\brief 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;
+}
+
+/**
+   \brief performs a smooth move.
+   \param from from where
+   \param to to where
+   \param t the time this transformation should take
+   \param res The approximation-density
+*/
+void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
+{
+  float tol[4];
+  double omega, cosom, sinom, scale0, scale1;
+  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;
+    }
+  
+  //if( (1.0 - cosom) > DELTA )
+  //{
+      omega = acos(cosom);
+      sinom = sin(omega);
+      scale0 = sin((1.0 - t) * omega) / sinom;
+      scale1 = sin(t * omega) / sinom;
+      //}
+      /*
+  else
+    {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+      */
+  res->v.x = scale0 * from->v.x + scale1 * tol[0];
+  res->v.y = scale0 * from->v.y + scale1 * tol[1];
+  res->v.z = scale0 * from->v.z + scale1 * tol[2];
+  res->w = scale0 * from->w + scale1 * tol[3];
+}
+
+
+/**
+   \brief 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];
+  }
+}
+
+/**
+   \brief outputs some nice formated debug information about this quaternion
+*/
+void Quaternion::debug(void)
+{
+  PRINT(0)("Quaternion Debug Information\n");
+  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
+}
+
+
+
+#endif /* _QUATERNION_H */
Index: orxonox/trunk/src/lib/math/vector.cc
===================================================================
--- orxonox/trunk/src/lib/math/vector.cc	(revision 3606)
+++ orxonox/trunk/src/lib/math/vector.cc	(revision 3607)
@@ -65,5 +65,5 @@
 float Vector::operator* (const Vector& v) const
 {
-  return x*v.x+y*v.y+z*v.z;
+  return x * v.x + y * v.y+ z * v.z;
 }
 
Index: orxonox/trunk/src/lib/math/vector_new.h
===================================================================
--- orxonox/trunk/src/lib/math/vector_new.h	(revision 3607)
+++ orxonox/trunk/src/lib/math/vector_new.h	(revision 3607)
@@ -0,0 +1,265 @@
+/*! 
+    \file vector.h
+    \brief A basic 3D math framework
+    
+    Contains classes to handle vectors, lines, rotations and planes
+*/ 
+
+#ifndef _VECTOR_H
+#define _VECTOR_H
+
+#include <math.h>
+//! PI the circle-constant
+#define PI 3.14159265359f  /* this is not nice... make a math_def file or something */ 
+
+//! 3D Vector
+/**
+	Class to handle 3D Vectors
+*/
+class Vector {
+
+  public:
+ 
+  float x; //!< The x Coordinate of the Vector.
+  float y; //!< The y Coordinate of the Vector.
+  float z; //!< The z Coordinate of the Vector.
+
+  Vector (float x, float y, float z) : x(x), y(y), z(z) {}  //!< assignment constructor
+  Vector () : x(0), y(0), z(0) {}
+  ~Vector () {}
+
+  Vector operator+ (const Vector& v) const;
+  Vector operator- (const Vector& v) const;
+  float operator* (const Vector& v) const;
+  Vector operator* (float f) const;
+  Vector operator/ (float f) const;
+  inline float dot (const Vector& v) const;
+  Vector cross (const Vector& v) const;
+  void scale(const Vector& v);
+  float len() const;
+  void normalize();
+  Vector* getNormalized();
+  Vector abs();
+
+  void debug();
+};
+
+//float angleDeg (const Vector& v1, const Vector& v2);
+//float angleRad (const Vector& v1, const Vector& v2);
+
+
+/**
+   \brief add two vectors
+   \param v: the other vector
+   \return the sum of both vectors
+*/
+Vector Vector::operator+ (const Vector& v) const
+{
+  Vector r;
+
+  r.x = x + v.x;
+  r.y = y + v.y;
+  r.z = z + v.z;
+  
+  return r;
+}
+
+/**
+   \brief subtract a vector from another
+   \param v: the other vector
+   \return the difference between the vectors
+*/
+Vector Vector::operator- (const Vector& v) const
+{
+  Vector r;
+  
+  r.x = x - v.x;
+  r.y = y - v.y;
+  r.z = z - v.z;
+  
+  return r;
+}
+
+/**
+   \brief calculate the dot product of two vectors
+   \param v: the other vector
+   \return the dot product of the vectors
+*/
+float Vector::operator* (const Vector& v) const
+{
+  return x * v.x + y * v.y + z * v.z;
+}
+
+/**
+   \brief multiply a vector with a float
+   \param f: the factor
+   \return the vector multipied by f
+*/
+Vector Vector::operator* (float f) const
+{  
+  Vector r;
+  
+  r.x = x * f;
+  r.y = y * f;
+  r.z = z * f;
+  
+  return r;
+}
+
+/**
+   \brief divide a vector with a float
+   \param f: the divisor
+   \return the vector divided by f   
+*/
+Vector Vector::operator/ (float f) const
+{
+  Vector r;
+  
+  if( f == 0.0)
+  {
+    // Prevent divide by zero
+    return Vector (0,0,0);
+  }
+  
+  r.x = x / f;
+  r.y = y / f;
+  r.z = z / f;
+  
+  return r;
+}
+
+/**
+   \brief calculate the dot product of two vectors
+   \param v: the other vector
+   \return the dot product of the vectors
+*/
+inline float Vector::dot (const Vector& v) const
+{
+  return x*v.x+y*v.y+z*v.z;
+}
+
+/**
+  \brief calculate the cross product of two vectors
+  \param v: the other vector
+	\return the cross product of the vectors
+*/
+Vector Vector::cross (const Vector& v) const
+{
+  Vector r;
+  
+  r.x = y * v.z - z * v.y;
+  r.y = z * v.x - x * v.z;
+  r.z = x * v.y - y * v.x;
+  
+  return r;
+}
+  
+/**
+   \brief normalizes the vector to lenght 1.0
+*/
+void Vector::normalize ()
+{
+  float l = len();
+  
+  if( l == 0.0)
+  {
+    // Prevent divide by zero
+    return;
+  }
+  
+  x = x / l;
+  y = y / l;
+  z = z / l;
+}
+
+
+/**
+   \brief returns the voctor normalized to length 1.0
+*/
+
+Vector* Vector::getNormalized()
+{
+  float l = len();
+  if(l != 1.0)
+    {
+      return this;
+    }
+  else if(l == 0.0)
+    {
+      return 0;
+    }
+  
+  Vector *normalizedVector = new Vector(x / l, y /l, z / l);
+  return normalizedVector;
+}
+
+/**
+   \brief scales this Vector with Vector v.
+   \param v the vector to scale this vector with
+*/
+void Vector::scale(const Vector& v)
+{
+  x *= v.x;
+  y *= v.y;
+  z *= v.z;
+}
+
+ 
+/**
+   \brief calculates the lenght of the vector
+   \return the lenght of the vector
+*/
+float Vector::len () const
+{
+  return sqrt (x*x+y*y+z*z);
+}
+
+
+/**
+   \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 calculate the angle between two vectors in radiances
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in radians
+*/
+float angleRad (const Vector& v1, const Vector& v2)
+{
+  return acos( v1 * v2 / (v1.len() * v2.len()));
+}
+
+
+/**
+   \brief calculate the angle between two vectors in degrees
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in degrees
+*/
+float angleDeg (const Vector& v1, const Vector& v2)
+{
+  float f;
+  f = acos( v1 * v2 / (v1.len() * v2.len()));
+  return f * 180 / PI;
+}
+
+
+/**
+   \brief Outputs the values of the Vector
+*/
+void Vector::debug(void)
+{
+  PRINT(0)("Vector Debug information\n");
+  PRINT(0)("x: %f; y: %f; z: %f", x, y, z);
+  PRINT(3)(" lenght: %f", len());
+  PRINT(0)("\n");
+}
+
+
+#endif /* _VECTOR_H */
Index: orxonox/trunk/src/track_node.cc
===================================================================
--- orxonox/trunk/src/track_node.cc	(revision 3606)
+++ orxonox/trunk/src/track_node.cc	(revision 3607)
@@ -46,5 +46,5 @@
   this->trackManager = TrackManager::getInstance();
   this->setMode(PNODE_ALL);
-  this->absCoordinate = *absCoordinate;
+  this->absCoordinate = absCoordinate;
 }
 
Index: orxonox/trunk/src/world_entities/primitive.cc
===================================================================
--- orxonox/trunk/src/world_entities/primitive.cc	(revision 3606)
+++ orxonox/trunk/src/world_entities/primitive.cc	(revision 3607)
@@ -20,5 +20,4 @@
 #include "stdincl.h"
 #include "world_entity.h"
-#include "vector.h"
 #include "objModel.h"
 
@@ -39,7 +38,9 @@
 
   this->material = new Material("Sphere");
-  this->material->setDiffuseMap("../data/pictures/load_screen.jpg");
+  //this->material->setDiffuseMap("../data/pictures/load_screen.jpg");
   this->material->setIllum(3);
-  this->material->setSpecular(1, 1, 1);
+  this->material->setAmbient(1, .5, 1);
+  Vector* v = new Vector();
+
 }
 
@@ -74,7 +75,7 @@
 void Primitive::tick (float time) 
 {
-  //  Vector v(0.0, 0.0, 1.0);
-  //  Quaternion q(10.0, v);
-  //  this->setRelDir(&(this->relDirection * q));
+  // Vector v(0.0, 0.0, 1.0);
+  // Quaternion q(10.0, v);
+  // this->setRelDir(&(this->relDirection * q));
 }
 
@@ -93,5 +94,7 @@
   //glMultMatrixf((float*)matrix);
   this->material->select();
-  gluSphere(this->object, 2, 20, 20);
+  gluSphere(this->object, 1, 6, 6);
+  //gluCylinder(this->object, 1, 1, 2, 6, 6);
+  //gluDisk(this->object, 1, 2, 6, 6);
 
   glPopMatrix();
Index: orxonox/trunk/src/world_entities/skysphere.cc
===================================================================
--- orxonox/trunk/src/world_entities/skysphere.cc	(revision 3606)
+++ orxonox/trunk/src/world_entities/skysphere.cc	(revision 3607)
@@ -100,7 +100,6 @@
   glPushMatrix();
   glMatrixMode(GL_MODELVIEW);
-  glTranslatef(this->absCoordinate.x,
-	       this->absCoordinate.y,
-	       this->absCoordinate.z);
+  Vector r = this->getAbsCoor();
+  glTranslatef(r.x, r.y, r.z);
 
   //glRotatef(-30, 1, 0, 0);
