Index: code/branches/Racingbot/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/Racingbot/src/modules/gametypes/RaceCheckPoint.cc	(revision 9459)
+++ code/branches/Racingbot/src/modules/gametypes/RaceCheckPoint.cc	(revision 9470)
@@ -63,5 +63,5 @@
 
         myPosition_= this->getPosition(); //eingefuegt
-        orxout(user_status) << "test" << std::endl;
+        //orxout(user_status) << "test" << std::endl;
 
     }
Index: code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc
===================================================================
--- code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc	(revision 9459)
+++ code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc	(revision 9470)
@@ -45,5 +45,6 @@
     CreateFactory(SpaceRaceController);
 
-    const int AdjustDistance = 500;
+    const int ADJUSTDISTANCE = 500;
+    const int MINDISTANCE=5;
     /*
      * Idea: Find static Point (checkpoints the spaceship has to reach)
@@ -93,6 +94,5 @@
      * returns a vector of static Point (checkpoints the spaceship has to reach)
      */
-    std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(
-            std::vector<RaceCheckPoint*> allCheckpoints)
+    std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(std::vector<RaceCheckPoint*> allCheckpoints)
     {
         std::map<RaceCheckPoint*, int> * zaehler = new std::map<
@@ -102,5 +102,5 @@
             zaehler->insert(std::pair<RaceCheckPoint*, int>(allCheckpoints[i],0));
         }
-        int maxWays = rekSimulationCheckpointsReached(zaehler->begin()->first,&allCheckpoints, zaehler);
+        int maxWays = rekSimulationCheckpointsReached(zaehler->begin()->first, zaehler);
 
         std::vector<RaceCheckPoint*> returnVec;
@@ -122,5 +122,5 @@
      * return how many ways go from the given Checkpoint to the last Checkpoint (of the Game)
      */
-    int SpaceRaceController::rekSimulationCheckpointsReached(RaceCheckPoint* currentCheckpoint, std::vector<RaceCheckPoint*>* checkpoints, std::map<RaceCheckPoint*, int>* zaehler)
+    int SpaceRaceController::rekSimulationCheckpointsReached(RaceCheckPoint* currentCheckpoint, std::map<RaceCheckPoint*, int>* zaehler)
     {
         if (currentCheckpoint->isLast())
@@ -132,9 +132,7 @@
         {
             int numberOfWays = 0; // counts number of ways from this Point to the last point
-            for (std::set<int>::iterator it =lastPositionSpaceship=this->getControllableEntity()->getPosition();
-                    currentCheckpoint->getNextCheckpoints().begin(); it
-                    != currentCheckpoint->getNextCheckpoints().end(); ++it)
-            {
-                numberOfWays += rekSimulationCheckpointsReached((*checkpoints)[(*it)], checkpoints, zaehler);
+            for (std::set<int>::iterator it = currentCheckpoint->getNextCheckpoints().begin(); it!= currentCheckpoint->getNextCheckpoints().end(); ++it)
+            {
+                numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
             }
             (*zaehler)[currentCheckpoint] += numberOfWays;
@@ -296,18 +294,59 @@
             lastPositionSpaceship=this->getControllableEntity()->getPosition();
         }
-        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()> AdjustDistance)
+        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
         {
             nextRaceCheckpoint_ = adjustNextPoint();
             lastPositionSpaceship=this->getControllableEntity()->getPosition();
         }
-        //korrigieren!
-        else if((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()<5){\
+        //korrigieren! done
+        else if((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt< MINDISTANCE  ){
             this->moveToPosition(Vector3(rnd()*100,rnd()*100,rnd()*100));
             this->spin();
-        }
+            //orxout(user_status) << "Mindistance reached" << std::endl;
+            return;
+        }
+        //orxout(user_status) << "dt= " << dt << ";  distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl;
+        lastPositionSpaceship=this->getControllableEntity()->getPosition();
         this->moveToPosition(nextRaceCheckpoint_->getPosition());
 
 
-    }
-
+        ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin();
+        /*if ( it->isA(RaceCheckPoint)){
+            orxout(user_status) << "works" << std::endl;
+        }
+        /*
+            for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
+                {
+                    if ((*it).isA(RaceCheckPoint))
+                    btVector3 temppos;
+                    it->
+                    btScalar temppos;
+                    btCollisionShape* temp= it->getCollisionShape(temppos, temppos);
+                    it->get
+
+                 }
+*/
+    }
+
+    int SpaceRaceController::pointToPointDistance(Vector3 point1, Vector3 point2){
+        for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
+                        {
+                            if ((*it).isA(RaceCheckPoint)){break;} // does not work jet
+
+                            for (int i=0; it->getAttachedCollisionShape(i)!=0; i++){
+                                btVector3 temppos;
+                                btScalar tempradius;
+                                it->getAttachedCollisionShape(i)->getCollisionShape()->getCollisionShape(temppos,tempradius);
+                                //http://bulletphysics.com/Bullet/BulletFull/btCollisionShape_8cpp_source.html#l00032
+                                //ueber shape moegliche Hindernisse bestimmen
+                            }
+                            it->getAttachedCollisionShape(i);
+
+
+                         }
+        const int DeltaStrecke = 5;
+        for( int i=0; i*DeltaStrecke-5 < (point1-point2).length(); i++){
+            return 0;
+        }
+    }
 }
Index: code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.h
===================================================================
--- code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.h	(revision 9459)
+++ code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.h	(revision 9470)
@@ -52,8 +52,9 @@
             std::vector<RaceCheckPoint*> findStaticCheckpoints(std::vector<RaceCheckPoint*>);
             std::vector<RaceCheckPoint*> staticCheckpoints();
-            int rekSimulationCheckpointsReached(RaceCheckPoint* , std::vector<RaceCheckPoint*>* checkpoints, std::map< RaceCheckPoint*, int>*);
+            int rekSimulationCheckpointsReached(RaceCheckPoint* , std::map< RaceCheckPoint*, int>*);
             // same as SpaceRaceManager, but needed to add virtuell Checkpoints ( Checkpoints which don't exist but needed to avoid collisions with big Objects)
             RaceCheckPoint* findCheckpoint(int index) const;
             bool addVirtualCheckPoint(int , RaceCheckPoint* , int , Vector3 );
+            int pointToPointDistance(Vector3, Vector3);
 
         public:
