Index: /branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
===================================================================
--- /branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7578)
+++ /branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7579)
@@ -389,7 +389,7 @@
      // 	Default Material
       this->Materials[i].mat = new Material();
-    this->Materials[i].mat->setDiffuse(0.1,0.1,0.1);
-    this->Materials[i].mat->setAmbient(0.1,0.1,0.1 );
-    this->Materials[i].mat->setSpecular(0.4,0.4,0.4);
+    this->Materials[i].mat->setDiffuse(0.1,0.1,1.0);
+    this->Materials[i].mat->setAmbient(0.1,0.1,1.0 );
+    this->Materials[i].mat->setSpecular(0.4,0.4,1.0);
     //this->Materials[i]->setShininess(100.0);
     this->Materials[i].mat->setTransparency(1.0);
Index: /branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- /branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc	(revision 7578)
+++ /branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc	(revision 7579)
@@ -24,5 +24,6 @@
 #include "camera.h"
 #include "vertex_array_model.h"
-
+#include "world_entities/player.h"
+#include "world_entities/playable.h"
 // STL Containers
 #include <vector>
@@ -64,10 +65,10 @@
   for(int i = 0; i < this->bspFile->numFaces; i++) this->alreadyVisible[i] = false;
   float tmp = 0;
-  this->opal.clear();
-  this->trasparent.clear();
+  //this->opal.clear();
+  //this->trasparent.clear();
   // Find all visible faces...
 
   this->cam = State::getCamera()->getAbsCoor() ;
-  this->ship = State::getCameraTargetNode()->getAbsCoor();
+  //this->ship = State::getCameraTargetNode()->getAbsCoor();
 
 
@@ -75,5 +76,5 @@
 
  
-  this->viewDir=    State::getCameraTarget()->getAbsCoor() -  State::getCamera()->getAbsCoor() ;
+ // this->viewDir=    State::getCameraTarget()->getAbsCoor() -  State::getCamera()->getAbsCoor() ;
   float d = (cam.x*viewDir.x + cam.y*viewDir.y + cam.z * viewDir.z);
 
@@ -90,9 +91,9 @@
   this->outputFraction = 1.0f;
   
-  this->checkCollisionRay(this->root,0.0f,1.0f, &(State::getCameraTargetNode()->getLastAbsCoor()), &this->cam);
+  //this->checkCollisionRay(this->root,0.0f,1.0f, &(State::getCameraTargetNode()->getLastAbsCoor()), &this->cam);
   
   if(this->outputFraction != 1.0f || this->outputAllSolid ) this->drawDebugCube(&this->cam);
 
-  if (true || (((int *)(this->bspFile->header))[35] == 0 )  || viscluster < 0)  //!< if (sizeof(Visdata) == 0)
+  if (false  || viscluster < 0 ) // || (((int *)(this->bspFile->header))[35] == 0 )  || viscluster < 0)  //!< if (sizeof(Visdata) == 0)
   {
    
@@ -141,7 +142,6 @@
     } //for
   } else {
-    int cluster;
-    int seven = 7;
-    unsigned char  one = 1;
+
+ 
     unsigned int v;
     unsigned char  visSet;
@@ -152,16 +152,16 @@
       leaf& camLeaf =  (this->bspFile->leaves)[ActLeaf->leafIndex] ;
       leaf& curLeaf =  (this->bspFile->leaves)[i] ;
-      cluster =  curLeaf.cluster;
+      int& cluster =  curLeaf.cluster;
 
       if(cluster < 0) continue;
       v = ((viscluster *  ( ((int *)this->bspFile->visData)[1]) ) + (cluster / 8));
-      visSet =((unsigned char*) (this->bspFile->visData))[v + 8];
-
-
-      if( !((visSet) & ((unsigned char)1 <<(unsigned char) (cluster &  7)))  ) {
+      visSet =((char*) (this->bspFile->visData))[v + 8];
+
+      // gets bit of visSet 
+      if( ((visSet) & (1 << (cluster &  7))) != 0 ) {
         // Iterate through all faces
         for (int j = 0; j < curLeaf.n_leaffaces ; ++j) {
-          const int f = (j +  curLeaf.leafface) % this->bspFile->numFaces;
-
+          const int g = (j +  curLeaf.leafface);
+          const int f = ((int *)this->bspFile->leafFaces)[g];
 
           if (!this->isAlreadyVisible(f) && f>=0) {
@@ -225,5 +225,5 @@
   }
 
-  glColor4f(3.0,3.0,3.0,1.0);
+ // glColor4f(3.0,3.0,3.0,1.0);
   glEnableClientState(GL_VERTEX_ARRAY );
   glEnableClientState(GL_TEXTURE_COORD_ARRAY );
@@ -320,5 +320,5 @@
     glEnable(GL_TEXTURE_2D);
   }
-  glColor4f(3.0,3.0,3.0,1.0);
+  //glColor4f(3.0,3.0,3.0,1.0);
 
   //glEnable( GL_AUTO_NORMAL);
@@ -383,5 +383,4 @@
     } else {
       node = node->right;
-
     }
   }
@@ -582,5 +581,10 @@
     leaf& camLeaf =  ((leaf *)(this->bspFile->leaves))[(node->leafIndex ) ];
 
-    if (camLeaf.cluster < 0) {this->drawDebugCube(&this->cam); this->drawDebugCube(&next);}
+    if (camLeaf.cluster < 0) {
+                              this->drawDebugCube(&this->cam); 
+                              this->drawDebugCube(&next);
+                              State::getPlayer()->getPlayable()->setRelCoor(-100,-100,-100);
+                              State::getPlayer()->getPlayable()->collidesWith(NULL, State::getCameraTargetNode()->getLastAbsCoor());
+                              }
 
 
