Index: code/branches/turretFS14/data/levels/turretTest.oxw
===================================================================
--- code/branches/turretFS14/data/levels/turretTest.oxw	(revision 10062)
+++ code/branches/turretFS14/data/levels/turretTest.oxw	(revision 10063)
@@ -52,34 +52,4 @@
   </collisionShapes>
 </SpaceShip>
-
-<Turret collisionType="dynamic" pitch=90 position="30,0,0">
-    <attached>
-      <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" pitch=-90/>
-      <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" pitch=-90/>
-      <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" pitch=-90/>
-      <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" pitch=-90/>
-      <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" pitch=-90/>
-
-      <Turret position="0,0,-10" collisionType="dynamic" pitch=20 angularDamping=0.999999 mass=100 maxPitch=45 maxYaw=45 maxAttackRadius=2000 minAttackRadius=30>
-        <attached>
-          <Model position="0,0,0" pitch="-90" roll="0" mesh="turretHead.mesh" scale3D="10,10,10"/>
-        </attached>
-        <collisionShapes>
-          <SphereCollisionShape radius="10"   position = "0,0,0"/>
-        </collisionShapes>
-        <controller>
-          <TurretController/>
-        </controller>
-        <?lua
-          include("includes/weaponSettingsTurret.oxi")
-        ?>
-      </Turret>
-    </attached>
-    
-    <controller>
-      <TeamTargetProxy team=10/>
-    </controller>
-  </Turret>
-
     
   </Scene>
Index: code/branches/turretFS14/src/modules/objects/Turret.cc
===================================================================
--- code/branches/turretFS14/src/modules/objects/Turret.cc	(revision 10062)
+++ code/branches/turretFS14/src/modules/objects/Turret.cc	(revision 10063)
@@ -63,13 +63,15 @@
 
         this->setRadarVisibility(false);
+
+        //this->rayTest_ = this->getScene()->getSceneManager()->createRayQuery(Ogre::Ray());
     }
 
     /**
         @brief 
-        Destructor. Nothing to see here.
+        Destructor. Destroys the rayTest_ element (if it was used)  .
      */
     Turret::~Turret()
     {
-
+        //this->getScene()->getSceneManager()->destroyQuery(this->rayTest_);
     }
 
@@ -87,5 +89,5 @@
         The squared distance to the position. -1, if it's ouside of range
     */
-    float Turret::isInRange(const WorldEntity* target ) const
+    float Turret::isInRange(const WorldEntity* target )
     {
         //Check distance
@@ -120,9 +122,9 @@
         }
 
-        Ogre::SceneManager* scenemanager = this->getScene()->getSceneManager();
-        Ogre::Ray ray = Ogre::Ray(this->getWorldPosition(), distance);
-        Ogre::DefaultRaySceneQuery rayscenequery = Ogre::DefaultRaySceneQuery(scenemanager);
-        rayscenequery.setRay(ray);
-       //rayscenequery.execute();
+        //TODO: Finish this. Find a way to convert objects from Ogre to Orxonox
+        /*Ogre::Ray ray = Ogre::Ray(this->getWorldPosition(), distance);
+        this->rayTest_->setRay(ray);
+        Ogre::RaySceneQueryResult result = this->rayTest_->execute();*/
+
 
         return distanceVal;
@@ -273,5 +275,5 @@
             //Don't make the rotation instantaneous. Use an arbitrary interpolation, not that great...
             //TODO: make the rotation better (constant velocity etc.). At the moment, the turret rotates
-            //      slower the closer it is to the destination
+            //slower the closer it is to the destination
             Quaternion drot = Quaternion::nlerp(dt*this->rotationThrust_/20.f, Quaternion::IDENTITY, this->rotation_);
             this->rotate(drot, WorldEntity::World);
Index: code/branches/turretFS14/src/modules/objects/Turret.h
===================================================================
--- code/branches/turretFS14/src/modules/objects/Turret.h	(revision 10062)
+++ code/branches/turretFS14/src/modules/objects/Turret.h	(revision 10063)
@@ -37,4 +37,5 @@
 #include "objects/ObjectsPrereqs.h"
 #include "worldentities/pawns/Pawn.h"
+#include <OgreSceneQuery.h>
 
 namespace orxonox
@@ -63,5 +64,5 @@
             virtual void rotateYaw(const Vector2& value);
             virtual void rotateRoll(const Vector2& value);
-            virtual float isInRange(const WorldEntity* target) const;
+            virtual float isInRange(const WorldEntity* target);
             virtual void aimAtPosition(const Vector3 &position);
 
@@ -119,4 +120,5 @@
             Ogre::Real maxYaw_; //!< The maxmium yaw the turret can have (on one side).
             float rotationThrust_;  //!< The velocity the turret rotates with.
+            Ogre::RaySceneQuery* rayTest_; //!< Used to perform a raytest, currently unused @see isInRange
 
     };
