Index: trunk/src/lib/collision_detection/aabb_tree_node.cc
===================================================================
--- trunk/src/lib/collision_detection/aabb_tree_node.cc	(revision 10695)
+++ trunk/src/lib/collision_detection/aabb_tree_node.cc	(revision 10698)
@@ -740,5 +740,5 @@
 
   /* DRAW POLYGONS */
-  if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED)
+  if( (drawMode & DRAW_BV_POLYGON) || (drawMode & DRAW_ALL) || (drawMode & DRAW_BV_BLENDED))
   {
     if (top)
Index: trunk/src/lib/event/key_mapper.cc
===================================================================
--- trunk/src/lib/event/key_mapper.cc	(revision 10695)
+++ trunk/src/lib/event/key_mapper.cc	(revision 10698)
@@ -47,4 +47,5 @@
 int KeyMapper::PEV_JUMP              = EV_UNKNOWN;
 int KeyMapper::PEV_ACTION            = EV_UNKNOWN;
+int KeyMapper::PEV_CROUCH            = EV_UNKNOWN;
 
 int KeyMapper::PEV_FIRE1             = EV_UNKNOWN;
@@ -87,4 +88,6 @@
       {&KeyMapper::PEV_JUMP,                 CONFIG_NAME_PLAYER_JUMP,            SDLK_SPACE},
       {&KeyMapper::PEV_ACTION,               CONFIG_NAME_PLAYER_ACTION,          SDLK_u},
+      {&KeyMapper::PEV_CROUCH,               CONFIG_NAME_PLAYER_CROUCH,          SDLK_LCTRL},
+
 
       {&KeyMapper::PEV_FIRE1,                CONFIG_NAME_PLAYER_FIRE,            EV_MOUSE_BUTTON_LEFT},
Index: trunk/src/lib/event/key_mapper.h
===================================================================
--- trunk/src/lib/event/key_mapper.h	(revision 10695)
+++ trunk/src/lib/event/key_mapper.h	(revision 10698)
@@ -58,4 +58,5 @@
   static int PEV_JUMP;              //!< jump
   static int PEV_ACTION;            //!< the action (or use) key
+  static int PEV_CROUCH;            //!< crouch
 
   static int PEV_FIRE1;             //!< fire button 1
Index: trunk/src/lib/graphics/importer/bsp/bsp_manager.cc
===================================================================
--- trunk/src/lib/graphics/importer/bsp/bsp_manager.cc	(revision 10695)
+++ trunk/src/lib/graphics/importer/bsp/bsp_manager.cc	(revision 10698)
@@ -173,5 +173,5 @@
   // erase alreadyVisible
   for(int i = 0; i < this->bspFile->numFaces; i++) this->alreadyVisible[i] = false;
-  float tmp = 0;
+//   float tmp = 0;
   //this->opal.clear();
   //this->trasparent.clear();
@@ -186,5 +186,5 @@
 
   this->viewDir=    State::getCamera()->getAbsDirX();
-  float d = (cam.x*viewDir.x + cam.y*viewDir.y + cam.z * viewDir.z);
+//   float d = (cam.x*viewDir.x + cam.y*viewDir.y + cam.z * viewDir.z);
 
   BspTreeNode*  ActLeaf = this->getLeaf(this->bspFile->root, &ship);
@@ -254,5 +254,5 @@
 
     for(int i = 0; i <  this->bspFile->numLeafs   ; ++i ) {
-      leaf& camLeaf =  (this->bspFile->leaves)[ActLeaf->leafIndex] ;
+//       leaf& camLeaf =  (this->bspFile->leaves)[ActLeaf->leafIndex] ;
       leaf& curLeaf =  (this->bspFile->leaves)[i] ;
       int& cluster =  curLeaf.cluster;
@@ -1696,4 +1696,21 @@
 
 
+float BspManager::checkCollisionRay(Vector StartPoint, Vector Direction, float length )
+{
+  Direction.normalize(); // Oder besser vor dem Fkt-Aufruf schon normalisieren
+  this->outputStartsOut = true;
+  this->outputAllSolid = false;
+  this->outputFraction = 1.0f;
+  this->inputStart =  StartPoint;
+  Vector End =   StartPoint + (Direction)*length;
+  this->inputEnd =   End;
+
+  this->checkCollisionRayN(this->root, 0.0f, 1.0f, &StartPoint, &(End) );
+
+  return (this->outputFraction * length);
+
+}
+
+
 
 /**
Index: trunk/src/lib/graphics/importer/bsp/bsp_manager.h
===================================================================
--- trunk/src/lib/graphics/importer/bsp/bsp_manager.h	(revision 10695)
+++ trunk/src/lib/graphics/importer/bsp/bsp_manager.h	(revision 10698)
@@ -77,4 +77,5 @@
   void checkCollision(WorldEntity* worldEntity); /*!< WorldEntities use this function to check wheter they collided with the BspEntity.
                                                       If a collision has been detected, the collides-function of worldEntity will be called.*/
+  float checkCollisionRay(Vector StartPoint, Vector Direction, float length ) ;
 
   int sortTransparency;              //!< sort transparent textures
Index: trunk/src/lib/math/quaternion.h
===================================================================
--- trunk/src/lib/math/quaternion.h	(revision 10695)
+++ trunk/src/lib/math/quaternion.h	(revision 10698)
@@ -50,7 +50,7 @@
 
     /** @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; };
+    inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
     /** @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; };
+    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); };
@@ -118,5 +118,5 @@
 
 
-    inline void slerpTo(const Quaternion& toQuat, float t);
+    void slerpTo(const Quaternion& toQuat, float t);
     static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
 
Index: trunk/src/lib/math/vector.h
===================================================================
--- trunk/src/lib/math/vector.h	(revision 10695)
+++ trunk/src/lib/math/vector.h	(revision 10698)
@@ -51,5 +51,5 @@
 
   /** @param index The index of the "array" @returns the x/y/z coordinate */
-  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }
+  inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; else return this->x; }
   /** @param v The vector to add @returns the addition between two vectors (this + v) */
   inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
@@ -64,4 +64,6 @@
   /** @param v The vector to substract  @returns the substraction between two vectors (this - v) */
   inline Vector operator- (const sVec3D& v) const { return Vector(x - v[0], y - v[1], z - v[2]); }
+  /** @returns the substraction between (0, 0, 0) and this (null-this) */
+  inline Vector operator- () const { return Vector(-x, -y, -z); }
   /** @param v The vector to substract  @returns the substraction between two vectors (this -= v) */
   inline const Vector& operator-= (const Vector& v) { this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this; };
