Index: branches/presentation/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9092)
+++ branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9093)
@@ -1166,5 +1166,5 @@
   {
     forward  = entity->getAbsCoor() +  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
-    backward = entity->getAbsCoor() -  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
+    backward = entity->getAbsCoor() +  box->center - dirX * (box->halfLength[0]  + BSP_X_OFFSET);
   }
   else
@@ -1203,5 +1203,6 @@
 
   // collision registration
-  if( xCollisionForward) {
+  if( xCollisionForward)
+  {
     entity->registerCollision(COLLISION_TYPE_AXIS_X ,
                               this->parent, entity,
@@ -1241,5 +1242,6 @@
 
   // collision registration
-  if( xCollisionBackward) {
+  if( xCollisionBackward)
+  {
     entity->registerCollision(COLLISION_TYPE_AXIS_X_NEG ,
                               this->parent, entity,
@@ -1248,11 +1250,164 @@
                               SolidFlag);
   }
-
-}
+}
+
 
 /**
- * check the collision in the y direction (up, down)
+ * check the collision in the z direction (up, down)
  */
 void BspManager::checkCollisionY(WorldEntity* entity)
+{
+
+  // Retrieve Bounding box
+  AABB* box = entity->getModelAABB();
+
+
+  plane*            testPlane          = NULL;  //!< the collision test plane
+
+  Vector            up;                         //!< up collision ray
+  Vector            down;                       //!< down collision ray
+  Vector            collPos;                    //!< the collision position
+
+  bool              yCollisionUp       = false; //!< flag true if right collision
+  bool              yCollisionDown     = false; //!< flag true if left collision
+  bool              SolidFlag          = false; //!< flag set true if solid
+
+  Vector            position;                   //!< current position of the entity
+  Vector            dirY;                       //!< direction x
+
+  position = entity->getAbsCoor();
+  collPos = position;
+  dirY =  Vector(0.0, 1.0, 0.0);
+
+  // calculate the rays
+  if( box != NULL)
+  {
+    up   = position +  box->center + dirY * (box->halfLength[1]  + BSP_Y_OFFSET);
+    down = position +  box->center - dirY * (box->halfLength[1]  + BSP_Y_OFFSET);
+  }
+  else
+  {
+    up   = position + dirY * 4.0f;
+    down = position + Vector(0.0, 1.0, 0.0) + dirY * 4.0;
+  }
+
+
+
+
+  /*   Y Ray up */
+  // init some member variables before collision check
+  this->inputStart = position;
+  this->inputEnd   = up;
+  this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &up );
+
+  if( !this->outputStartsOut )
+  {
+    this->collPlane = new plane;
+    this->collPlane->x = 0.0f;
+    this->collPlane->y = 0.0f;
+    this->collPlane->z = 0.0f;
+    yCollisionUp = true;
+  }
+  else
+  {
+    if( this->outputFraction == 1.0f)
+    {
+      if( this->outputAllSolid )
+      {
+        this->collPlane = new plane;
+        this->collPlane->x = 0.0f;
+        this->collPlane->y = 0.0f;
+        this->collPlane->z = 0.0f;
+        yCollisionUp = true;
+        SolidFlag = true;
+      }
+      else
+      {
+        yCollisionUp = false;
+        collPos = up;
+      }
+    }
+    else
+    {
+      yCollisionUp = true;
+      collPos = position + (up - position) * this->outputFraction;
+      this->out = collPos;        // why this????
+    }
+  }
+  testPlane = this->collPlane;
+
+  // collision registration
+  if( yCollisionUp)
+  {
+    entity->registerCollision(COLLISION_TYPE_AXIS_Y , this->parent,
+                              entity,
+                              Vector(testPlane->x, testPlane->y, testPlane->z),
+                              collPos, SolidFlag);
+  }
+
+
+
+
+  /*   Y Ray down */
+  // init some member variables before collision check
+  this->inputStart = position;
+  this->inputEnd   = down;
+  this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &down );
+
+  if( !this->outputStartsOut )
+  {
+    this->collPlane = new plane;
+    this->collPlane->x = 0.0f;
+    this->collPlane->y = 0.0f;
+    this->collPlane->z = 0.0f;
+    yCollisionDown = true;
+  }
+  else
+  {
+    if( this->outputFraction == 1.0f)
+    {
+      if( this->outputAllSolid )
+      {
+        this->collPlane = new plane;
+        this->collPlane->x = 0.0f;
+        this->collPlane->y = 0.0f;
+        this->collPlane->z = 0.0f;
+        yCollisionDown = true;
+        SolidFlag = true;
+      }
+      else
+      {
+        yCollisionDown = false;
+        collPos = down;
+      }
+    }
+    else
+    {
+      yCollisionDown = true;
+      collPos = position + (down - position) * this->outputFraction;
+      this->out = collPos;        // why this????
+    }
+  }
+  testPlane = this->collPlane;
+
+  // collision registration
+  if( yCollisionDown)
+  {
+    entity->registerCollision(COLLISION_TYPE_AXIS_Y_NEG , this->parent,
+                              entity,
+                              Vector(testPlane->x, testPlane->y, testPlane->z),
+                              collPos, SolidFlag);
+  }
+
+
+}
+
+
+
+
+/**
+ * check the collision in the z direction (left, right)
+ */
+void BspManager::checkCollisionZ(WorldEntity* entity)
 {
   // Retrieve Bounding box
@@ -1280,5 +1435,5 @@
   {
     right = entity->getAbsCoor() +  box->center + dirZ * (box->halfLength[2]  + BSP_Z_OFFSET);
-    left  = entity->getAbsCoor() -  box->center + dirZ * (box->halfLength[2]  + BSP_Z_OFFSET);
+    left  = entity->getAbsCoor() +  box->center - dirZ * (box->halfLength[2]  + BSP_Z_OFFSET);
   }
   else
@@ -1321,7 +1476,7 @@
   if( zCollisionRight) {
     entity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent,
-                                   entity,
-                                   Vector(testPlane->x, testPlane->y, testPlane->z),
-                                   collPos , SolidFlag);
+                              entity,
+                              Vector(testPlane->x, testPlane->y, testPlane->z),
+                              collPos , SolidFlag);
   }
 
@@ -1366,14 +1521,4 @@
 
 }
-
-
-/**
- * check the collision in the z direction (left, right)
- */
-void BspManager::checkCollisionZ(WorldEntity* entity)
-{
-
-}
-
 
 
