Index: /branches/presentation/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- /branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9080)
+++ /branches/presentation/src/lib/graphics/importer/bsp_manager.cc	(revision 9081)
@@ -1143,10 +1143,10 @@
 {
   // Retrieve Bounding box
-  AABB* box = worldEntity->getModelAABB();
+  AABB* box = entity->getModelAABB();
 
 
   Vector forwardDir = Vector(0.0,0.0,1.0);
   Vector upDir = Vector(0.0,1.0,0.0);
-  Vector position = worldEntity->getAbsCoor();
+  Vector position = entity->getAbsCoor();
 
   bool SolidFlag = false;
@@ -1156,8 +1156,8 @@
   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;
+  Vector dest = entity->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;
@@ -1174,12 +1174,14 @@
   Vector            right;                      //!< right collision ray
 
+  Vector dest1;
+
   float height = 40;
 
-  Vector dirX =  worldEntity->getAbsDirX(); dirX.y = 0.0f; dirX.normalize();
+  Vector dirX =  entity->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);
+    left  = entity->getAbsCoor() +  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
+    right = entity->getAbsCoor() -  box->center + dirX * (box->halfLength[0]  + BSP_X_OFFSET);
   }
   else
@@ -1192,52 +1194,4 @@
 //     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;
-
 
 
@@ -1247,6 +1201,6 @@
   this->outputFraction = 1.0f;
   this->inputStart =  position1;
-  this->inputEnd =   dest1;
-  this->checkCollisionRayN(this->root,0.0f,1.0f, &position1, &dest1 );
+//   this->inputEnd =   dest1;                                                 <===============
+//  this->checkCollisionRayN(this->root,0.0f,1.0f, &position1, &dest1 );
 
   if(this->outputFraction < 1.0f) {
@@ -1270,44 +1224,10 @@
 
 
-      // 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);
-  }
+  if( xCollision) {
+    entity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, entity,
+                                   Vector(testPlane->x, testPlane->y, testPlane->z),dest1 ,
+                                   SolidFlag);
+  }
+
 }
 
