Index: branches/presentation/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9078)
+++ branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9080)
@@ -960,4 +960,5 @@
   this->outputFraction = 1.0f;
 
+
   // Retrieve Bounding box
   AABB* box = worldEntity->getModelAABB();
@@ -1135,4 +1136,201 @@
 
 
+
+/**
+ * check the collision in the x direction (forward, backward)
+ */
+void BspManager::checkCollisionX(WorldEntity* entity)
+{
+  // Retrieve Bounding box
+  AABB* box = worldEntity->getModelAABB();
+
+
+  Vector forwardDir = Vector(0.0,0.0,1.0);
+  Vector upDir = Vector(0.0,1.0,0.0);
+  Vector position = worldEntity->getAbsCoor();
+
+  bool SolidFlag = false;
+  bool collision = false;
+  Vector position1 = position;
+  Vector position2 = position + Vector(0.0,1.0,0.0);
+  Vector position3 = position;
+  Vector position4 = position + Vector(0.0,1.0,0.0);
+  Vector dest = worldEntity->getAbsCoor() - upDir*40.0f; //
+
+  Vector dest3 = position + forwardDir*4.0f;
+  Vector dest4 = position2 + forwardDir*4.0;
+  dest = position - Vector(0.0, 40.0,0.0);
+  Vector out = dest;
+  Vector out1;
+  Vector out2;
+
+
+  plane* testPlane;
+
+  bool xCollision = false;
+  bool zCollision = false;
+
+  Vector            left;                       //!< left collision ray
+  Vector            right;                      //!< right collision ray
+
+  float height = 40;
+
+  Vector dirX =  worldEntity->getAbsDirX(); dirX.y = 0.0f; dirX.normalize();
+
+  if( box != NULL)
+  {
+    left  = worldEntity->getAbsCoor() +  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
+    right = worldEntity->getAbsCoor() -  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
+  }
+  else
+  {
+    left  = position + forwardDir*4.0f;
+    right = position2 + forwardDir*4.0;
+  }
+
+    //
+//     dest1
+//     dest2
+
+
+
+  // 1st Ray: Y RAY
+  this->inputStart =  position;
+  this->inputEnd =   dest;
+  this->checkCollisionRayN(this->root,0.0f,1.0f, &position, &dest );
+
+
+  //
+  if(!this->outputStartsOut ) {
+    this->collPlane = new plane;
+    this->collPlane->x = 0.0f;
+    this->collPlane->y = 0.0f;
+    this->collPlane->z = 0.0f;
+    collision = 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;
+        collision = true;
+        SolidFlag = true;
+      } else
+        collision = false;
+
+
+        out = dest;
+
+    } else {
+      collision = true;
+      out.x = position.x + (dest.x -position.x) * this->outputFraction;
+      out.y = position.y + (dest.y -position.y) * this->outputFraction;
+      out.z = position.z + (dest.z -position.z) * this->outputFraction;
+
+      Vector out3 = out + Vector(height*this->collPlane->x,height*this->collPlane->y,height*this->collPlane->z);
+      this->out = out;
+    }
+  }
+  testPlane = this->collPlane;
+
+
+  bool xCollisionNeg = false;
+  bool zCollisionNeg = false;
+
+
+
+    // 2nd Collision Detection X-RAY
+  this->outputStartsOut = true;
+  this->outputAllSolid = false;
+  this->outputFraction = 1.0f;
+  this->inputStart =  position1;
+  this->inputEnd =   dest1;
+  this->checkCollisionRayN(this->root,0.0f,1.0f, &position1, &dest1 );
+
+  if(this->outputFraction < 1.0f) {
+    out.x = dest1.x + (dest1.x -position1.x) * this->outputFraction;
+    dest1 = position1 + (dest1 -position1) * this->outputFraction;
+    xCollision = true;
+    testPlane = this->collPlane;
+  }
+  if(this->outputAllSolid ) {
+
+    this->collPlane = new plane;
+    this->collPlane->x = 0.0f;
+    this->collPlane->y = 0.0f;
+    this->collPlane->z = 0.0f;
+    testPlane = this->collPlane;
+    SolidFlag = true;
+    xCollision = true;
+  }
+    //out.z = this->outputFraction;
+
+
+
+      // 3rd Collision Detection Z-RAY
+  this->outputStartsOut = true;
+  this->outputAllSolid = false;
+  this->outputFraction = 1.0f;
+  this->inputStart =  position2;
+  this->inputEnd =   dest2;
+
+  this->checkCollisionRayN(this->root,0.0f,1.0f, &position2, &dest2 );
+      //out.x = this->outputFraction;
+
+  if(this->outputFraction < 1.0f ) {
+    out.z = out.z = dest2.z + (dest2.z -position2.z) * this->outputFraction;
+    dest2 = position2 + (dest2 -position2) * this->outputFraction;
+    zCollision = true;
+    testPlane = this->collPlane;
+
+  }
+  if(this->outputAllSolid ) {
+    this->collPlane = new plane;
+    this->collPlane->x = 0.0f;
+    this->collPlane->y = 0.0f;
+    this->collPlane->z = 0.0f;
+    testPlane = this->collPlane;
+
+    SolidFlag = true;
+    zCollision = true;
+  }
+
+
+  // Return the normal here: Normal's stored in this->collPlane;
+  if( collision) {
+    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag);
+  }
+  if(xCollision) {
+    worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z),dest1 , SolidFlag);
+  }
+
+  if(zCollision) {
+    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), dest2 , SolidFlag);
+  }
+}
+
+/**
+ * check the collision in the y direction (up, down)
+ */
+void BspManager::checkCollisionY(WorldEntity* entity)
+{
+
+}
+
+
+/**
+ * check the collision in the z direction (left, right)
+ */
+void BspManager::checkCollisionZ(WorldEntity* entity)
+{
+
+}
+
+
+
+
+
 void  BspManager::checkCollision(BspTreeNode* node, Vector* cam)
 {
Index: branches/presentation/src/lib/graphics/importer/bsp_manager.h
===================================================================
--- branches/presentation/src/lib/graphics/importer/bsp_manager.h	(revision 9078)
+++ branches/presentation/src/lib/graphics/importer/bsp_manager.h	(revision 9080)
@@ -79,16 +79,24 @@
 
 private:
-  // Functions
+  // collision functions
   BspTreeNode* getLeaf(BspTreeNode*  node,   Vector* cam) ;  //!< Traverses the tree
   void  checkCollision(BspTreeNode* node, Vector* cam); //!< Obsolete. Use this function for debugging only!
   void  checkCollisionRay(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end);
   void  checkCollisionRayN(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end);
-  void  TraceBox( Vector& inputStart, Vector& inputEnd,Vector& inputMins, Vector& inputMaxs );
+
+  void checkCollisionX(WorldEntity* entity);
+  void checkCollisionY(WorldEntity* entity);
+  void checkCollisionZ(WorldEntity* entity);
+
   void  checkCollisionBox(void);
   void  checkBrushRay(brush* curBrush);
   void  checkBrushRayN(brush* curBrush);
   void  checkBrushRayN(brush* curBrush, Vector& inputStart, Vector& inputEnd);
-  float  checkPatchAltitude(BspTreeNode* node); //! To be implemented...
+  float checkPatchAltitude(BspTreeNode* node); //! To be implemented...
 
+  void  TraceBox( Vector& inputStart, Vector& inputEnd,Vector& inputMins, Vector& inputMaxs );
+
+
+  // visibility functions
   void drawDebugCube(Vector* cam);
   bool isAlreadyVisible(int Face);
