Index: code/branches/turretFS14/data/levels/includes/weaponSettingsTurretTest.oxi
===================================================================
--- code/branches/turretFS14/data/levels/includes/weaponSettingsTurretTest.oxi	(revision 10004)
+++ code/branches/turretFS14/data/levels/includes/weaponSettingsTurretTest.oxi	(revision 10004)
@@ -0,0 +1,22 @@
+    <weaponslots>
+      <WeaponSlot position="0,0,0" />
+    </weaponslots>
+    <weaponsets>
+      <WeaponSet firemode=0 />
+    </weaponsets>
+    <weapons>
+      <WeaponPack>
+        <links>
+          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+        </links>
+        <Weapon>
+          <attached>
+            <Model mesh="sphere.mesh" position="3,3,-2.2" scale=0.6 />
+          </attached>
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=0 material="Flares/point_lensflare" muzzleoffset=" 3, 3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=0 material="Flares/point_lensflare" muzzleoffset=" 3,-3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=0 material="Flares/point_lensflare" muzzleoffset="-3, 3,-2.2" />
+          <HsW01 mode=0 munitionpershot=0 delay=0 damage=0 material="Flares/point_lensflare" muzzleoffset="-3,-3,-2.2" />
+        </Weapon>
+      </WeaponPack>
+    </weapons>
Index: code/branches/turretFS14/data/levels/templates/spaceshipTurretTest.oxt
===================================================================
--- code/branches/turretFS14/data/levels/templates/spaceshipTurretTest.oxt	(revision 10004)
+++ code/branches/turretFS14/data/levels/templates/spaceshipTurretTest.oxt	(revision 10004)
@@ -0,0 +1,60 @@
+<Template name=spaceshipturrettest>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipturretcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <attached>
+        <Model position="0,0,0" yaw="90" roll="-90" mesh="turretHead.mesh" scale3D="10,10,10"/>
+    </attached>
+    <collisionShapes>
+        <SphereCollisionShape radius="10"   position = "0,0,0"/>
+    </collisionShapes>
+<?lua
+  include("../includes/weaponSettingsTurretTest.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipturretcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,10, 40" drag=true mouselook=true />
+      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
Index: code/branches/turretFS14/data/levels/turretTest.oxw
===================================================================
--- code/branches/turretFS14/data/levels/turretTest.oxw	(revision 9998)
+++ code/branches/turretFS14/data/levels/turretTest.oxw	(revision 10004)
@@ -17,5 +17,5 @@
   include("templates/spaceshipAssff.oxt")
   include("templates/spaceshipPirate.oxt")
-  include("templates/spaceshipTurret.oxt")
+  include("templates/spaceshipTurretTest.oxt")
 ?>
 
@@ -48,5 +48,5 @@
 <Turret position="0,10,0" pitch="90" yaw="0" roll="0">
     <templates>
-        <Template link=spaceshipturret />
+        <Template link=spaceshipturrettest />
     </templates>
     <controller>
Index: code/branches/turretFS14/src/modules/objects/Turret.cc
===================================================================
--- code/branches/turretFS14/src/modules/objects/Turret.cc	(revision 9998)
+++ code/branches/turretFS14/src/modules/objects/Turret.cc	(revision 10004)
@@ -37,4 +37,6 @@
     RegisterClass(Turret);
 
+
+
     /**
      * @brief Constructor
@@ -44,4 +46,5 @@
         RegisterObject(Turret);
         this->controller_ = new WaypointPatrolController(this->getContext());
+        gotOrient_ = false;
     }
 
@@ -57,13 +60,63 @@
     void Turret::rotatePitch(const Vector2& value)
     {
-        orxout()<< "Turret rotate Pitch"<< endl;
-
-        const Quaternion& orient = this->getOrientation();
-        Radian pitch = orient.getPitch();
-
-        if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
-            SpaceShip::rotatePitch(value);
+        Radian currentPitch = this->getOrientation().getPitch();
+        Radian startPitch = startOrient_.getPitch();
+        Radian limit = Radian((Degree)45);
+        Radian upperBoundary = startPitch+limit;
+        if(upperBoundary > Radian(Degree(360)))
+        {
+            upperBoundary -= Radian(Degree(360));
+        }
+        Radian lowerBoundary = startPitch-limit;
+        if(lowerBoundary < Radian(Degree(0)))
+        {
+            lowerBoundary += Radian(Degree(360));
+        }
+        //orxout() << "Pitch:\t" << currentPitch << "\t" << startPitch << endl;
+        
+        if(currentPitch > upperBoundary && value.x > 0 ||
+           currentPitch < lowerBoundary && value.x < 0)
+        {
+            return;
+        }
+        
+        //SpaceShip::rotatePitch(value);
     }
 
+    void Turret::rotateYaw(const Vector2& value)
+    {
+
+        Radian currentYaw = this->getOrientation().getYaw();
+        Radian startYaw = startOrient_.getYaw();
+        Radian limit = Radian(Degree(45));
+        Radian upperBoundary = startYaw + limit;
+        Radian lowerBoundary = startYaw - limit;
+        orxout() << currentYaw << " " << this->getOrientation().getRoll() << endl;
+        /*if(upperBoundary >= Radian(Degree(180)));
+        {
+            upperBoundary -= Radian(Degree(180));
+            lowerBoundary -= Radian(Degree(180));
+            currentYaw -= Radian(Degree(180));
+        }
+        if(lowerBoundary <= Radian(Degree(-180)))
+        {
+            lowerBoundary += Radian(Degree(180));
+            upperBoundary += Radian(Degree(180));
+            currentYaw += Radian(Degree(180));
+        }*/
+        //orxout() << "Yaw:\t" << (Degree)currentYaw << "\t" << (Degree)upperBoundary << "\t" << (Degree)lowerBoundary << endl;
+        //if((currentYaw > upperBoundary && value.x > 0) ||
+        //   (currentYaw < lowerBoundary && value.x < 0))
+        if((currentYaw < Radian(1) && value.x < 0) || (currentYaw > Radian(3) && value.x>0))
+        {
+            //return;
+        }
+        SpaceShip::rotateYaw(value);
+    }
+
+    void Turret::rotateRoll(const Vector2& value)
+    {
+        return;
+    }
 
     void Turret::setAlertnessRadius(float value)
@@ -82,4 +135,13 @@
     }
 
+    void Turret::tick(float dt)
+    {
+        if(!gotOrient_)
+        {
+            startOrient_ = this->getOrientation();
+            gotOrient_ = true;
+        }
+        SUPER(Turret, tick, dt);
+    }
 
 }
Index: code/branches/turretFS14/src/modules/objects/Turret.h
===================================================================
--- code/branches/turretFS14/src/modules/objects/Turret.h	(revision 9998)
+++ code/branches/turretFS14/src/modules/objects/Turret.h	(revision 10004)
@@ -37,4 +37,5 @@
 
 #include "objects/ObjectsPrereqs.h"
+#include "OgreQuaternion.h"
 
 #include "worldentities/pawns/SpaceShip.h"
@@ -48,7 +49,7 @@
             virtual ~Turret();
 
-            //virtual void tick(float dt);
-
             virtual void rotatePitch(const Vector2& value);
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
 
             void setAlertnessRadius(float value);
@@ -56,4 +57,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
 
 
@@ -61,5 +63,7 @@
             WaypointPatrolController* controller_;
         private:
-
+            bool gotOrient_;
+            Quaternion startOrient_;
+            Quaternion firstOrient_;
     };
 }
