Index: /orxonox/trunk/src/lib/coord/p_node.cc
===================================================================
--- /orxonox/trunk/src/lib/coord/p_node.cc	(revision 4999)
+++ /orxonox/trunk/src/lib/coord/p_node.cc	(revision 5000)
@@ -483,8 +483,8 @@
   parentNode->addChild(this);
 
-/*  if (this->parentMode & PNODE_ROTATE_MOVEMENT)
-  this->setRelCoor(parent->getRelDir().apply(tmpV - parent->getAbsCoor()));
-  else*/
-  this->setRelCoor(tmpV - parentNode->getAbsCoor());
+ if (this->parentMode & PNODE_ROTATE_MOVEMENT)
+   this->setRelCoor(this->parent->getAbsDir().inverse().apply(tmpV - this->parent->getAbsCoor()));
+ else
+   this->setRelCoor(tmpV - parentNode->getAbsCoor());
 
   this->setRelDir(tmpQ / parentNode->getAbsDir());
@@ -542,13 +542,13 @@
       if (unlikely(this->toDirection != NULL))
       {
-        Quaternion rotQuat = Quaternion(.1, Vector(0,1,0));// (*this->toDirection / this->relDirection);
+        Quaternion rotQuat = (*this->toDirection / this->relDirection)*dt;
 //         printf("1: ");
 //         this->relDirection.debug();
 //         printf("2: ");
 //         this->toDirection->debug();
-//         printf("3: ");
-//         rotQuat.debug();
-
-        if (true)//likely(rotQuat.len() >= .001))
+        //printf("3: ");
+        //rotQuat.debug2();
+
+        if (likely(rotQuat.getSpacialAxisAngle() >= .01))
         {
           this->shiftDir(rotQuat);
@@ -556,7 +556,7 @@
         else
         {
-          delete this->toCoordinate;
-          this->toCoordinate = NULL;
-          PRINTF(5)("SmoothMove of %s finished\n", this->getName());
+          delete this->toDirection;
+          this->toDirection = NULL;
+          PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
         }
       }
Index: /orxonox/trunk/src/lib/coord/p_node.h
===================================================================
--- /orxonox/trunk/src/lib/coord/p_node.h	(revision 4999)
+++ /orxonox/trunk/src/lib/coord/p_node.h	(revision 5000)
@@ -26,7 +26,4 @@
 
 // FORWARD DEFINITION \\
-class PNode; /* forward decleration, so that parentEntry has access to PNode */
-//class Quaternion;
-//class Vector;
 class TiXmlElement;
 template<class T> class tList;
Index: /orxonox/trunk/src/lib/math/vector.cc
===================================================================
--- /orxonox/trunk/src/lib/math/vector.cc	(revision 4999)
+++ /orxonox/trunk/src/lib/math/vector.cc	(revision 5000)
@@ -282,4 +282,10 @@
 }
 
+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 );
+}
+
 /**
  *  create a rotation from a vector
Index: /orxonox/trunk/src/lib/math/vector.h
===================================================================
--- /orxonox/trunk/src/lib/math/vector.h	(revision 4999)
+++ /orxonox/trunk/src/lib/math/vector.h	(revision 5000)
@@ -157,7 +157,7 @@
   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 w*w + v.x*v.x + v.y*v.y + v.z*v.z; };
+  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() / norm(); };
+  inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); };
   /** @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; };
@@ -176,4 +176,5 @@
 
   void debug();
+  void debug2();
 
 
Index: /orxonox/trunk/src/world_entities/camera.cc
===================================================================
--- /orxonox/trunk/src/world_entities/camera.cc	(revision 4999)
+++ /orxonox/trunk/src/world_entities/camera.cc	(revision 5000)
@@ -142,9 +142,9 @@
     case VIEW_FRONT:
       this->toFovy = 120.0;
-//       this->softReparent("Player");
-//       this->target->softReparent("Player");
-//       this->setRelCoorSoft(4, 0, 0);
-//       this->target->setRelCoorSoft(10,0,0);
-      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
+       this->softReparent("Player");
+       this->target->softReparent("Player");
+       this->setRelCoorSoft(4, 0, 0);
+       this->target->setRelCoorSoft(10,0,0);
+      //this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
       break;
     case VIEW_LEFT:
Index: /orxonox/trunk/src/world_entities/player.cc
===================================================================
--- /orxonox/trunk/src/world_entities/player.cc	(revision 4999)
+++ /orxonox/trunk/src/world_entities/player.cc	(revision 5000)
@@ -121,5 +121,5 @@
 void Player::init()
 {
-  this->setAbsDir(0,1,0);
+//  this->setAbsDir(0,1,0);
 
   this->setClassID(CL_PLAYER, "Player");
Index: /orxonox/trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4999)
+++ /orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 5000)
@@ -178,11 +178,5 @@
 
   pj->setParent(NullParent::getInstance());
-/*
-  PNode* target = this->getWeaponManager()->getFixedTarget();
-  if (target != NULL)
-  {
-    pj->setVelocity(this->getVelocity()+(target->getAbsCoor() - this->getAbsCoor())*.5);//this->getVelocity());
-  }
-  else*/
+
   pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*20);
 
@@ -219,15 +213,14 @@
 void TestGun::draw ()
 {
-  this->getWeaponManager()->getFixedTarget()->debugDraw(10);
-
   /* draw gun body */
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
-  float matrix[4][4];
   glTranslatef (this->getAbsCoor ().x,
                 this->getAbsCoor ().y,
                 this->getAbsCoor ().z);
-  this->getAbsDir ().matrix (matrix);
-  glMultMatrixf((float*)matrix);
+
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
   if( this->leftRight == W_RIGHT)
     glScalef(1.0, 1.0, -1.0);
@@ -241,6 +234,6 @@
                 this->objectComponent1->getAbsCoor ().y,
                 this->objectComponent1->getAbsCoor ().z);
-  this->objectComponent1->getAbsDir ().matrix (matrix);
-  glMultMatrixf((float*)matrix);
+  tmpRot = this->objectComponent1->getAbsDir().getSpacialAxis();
+  glRotatef (this->objectComponent1->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
   this->model->draw(0);
   glPopMatrix();
Index: /orxonox/trunk/src/world_entities/weapons/turret.cc
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/turret.cc	(revision 4999)
+++ /orxonox/trunk/src/world_entities/weapons/turret.cc	(revision 5000)
@@ -164,10 +164,9 @@
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
-  float matrix[4][4];
   glTranslatef (this->getAbsCoor ().x,
                 this->getAbsCoor ().y,
                 this->getAbsCoor ().z);
-  this->getAbsDir ().matrix (matrix);
-  glMultMatrixf((float*)matrix);
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
 
   this->model->draw();
