Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc @ 9507

Last change on this file since 9507 was 9507, checked in by purgham, 11 years ago

Not working together

File size: 23.3 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *  Created on: Oct 8, 2012
23 *      Author: purgham
24 */
25
26/**
27 * Conventions:
28 * -first Checkpoint has index 0
29 * -staticCheckPoint= static Point (see def over = constructor)
30 */
31
32/*TODO:
33 * tICK KORRIGIEREN
34 *
35 *
36 */
37#include <gametypes/SpaceRaceController.h>
38#include "core/CoreIncludes.h"
39#include "core/XMLPort.h"
40#include "gametypes/SpaceRaceManager.h"
41#include "collisionshapes/CollisionShape.h"
42#include "BulletCollision/CollisionShapes/btCollisionShape.h"
43
44namespace orxonox
45{
46    CreateFactory(SpaceRaceController);
47
48    const int ADJUSTDISTANCE = 500;
49    const int MINDISTANCE = 5;
50    /*
51     * Idea: Find static Point (checkpoints the spaceship has to reach)
52     */
53    SpaceRaceController::SpaceRaceController(BaseObject* creator) :
54        ArtificialController(creator)
55    {
56        RegisterObject(SpaceRaceController)
57;        std::vector<RaceCheckPoint*> checkpoints;
58        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
59        {
60            checkpoints = it->getAllCheckpoints();
61            nextRaceCheckpoint_=it->findCheckpoint(0);
62        }
63
64        OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
65        checkpoints_=checkpoints;
66        for( std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it!=checkpoints.end(); ++it)
67        {
68            std::set<int> nextCheckPoints = ((*it)->getNextCheckpoints());
69            if(!nextCheckPoints.empty()) {
70                orxout() << "yay" << endl;
71                for (std::set<int>::iterator numb = nextCheckPoints.begin(); numb!=nextCheckPoints.end(); numb++) {
72                    RaceCheckPoint* point2 = findCheckpoint((*numb));
73
74                    if(point2 != NULL)
75                        placeVirtualCheckpoints((*it), point2);
76                }
77            }
78        }
79        staticRacePoints_ = findStaticCheckpoints(checkpoints);
80        // initialisation of currentRaceCheckpoint_
81        currentRaceCheckpoint_ = NULL;
82        /*
83         // find first Checkpoint
84         for (int i=0; true; i++){
85         if(checkpoints_[i]->getCheckpointIndex()==0){
86         nextRaceCheckpoint_=checkpoints_[i];
87         break;
88         }
89         }*/
90
91        virtualCheckPointIndex=-2;
92    }
93
94    //------------------------------
95    // functions for initialisation
96
97    void SpaceRaceController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
98    {
99        SUPER(SpaceRaceController, XMLPort, xmlelement, mode);
100        XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
101        XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
102
103    }
104
105    /*
106     * called from constructor 'SpaceRaceController'
107     * returns a vector of static Point (checkpoints the spaceship has to reach)
108     */
109    std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(std::vector<RaceCheckPoint*> allCheckpoints)
110    {
111        std::map<RaceCheckPoint*, int> * zaehler = new std::map<
112        RaceCheckPoint*, int>(); // counts how many times the checkpoit was reached (for simulation)
113        for (unsigned int i = 0; i < allCheckpoints.size(); i++)
114        {
115            zaehler->insert(std::pair<RaceCheckPoint*, int>(allCheckpoints[i],0));
116        }
117        int maxWays = rekSimulationCheckpointsReached(zaehler->begin()->first, zaehler);
118
119        std::vector<RaceCheckPoint*> returnVec;
120        returnVec.clear();
121        for (std::map<RaceCheckPoint*, int>::iterator iter = zaehler->begin(); iter!= zaehler->end(); iter++)
122        {
123            if (iter->second == maxWays)
124            {
125                //returnVec.insert(allCheckpoints[1]);
126                returnVec.insert(returnVec.end(), iter->first);
127            }
128        }
129        delete zaehler;
130        return returnVec;
131    }
132
133    /*
134     * called from 'findStaticCheckpoints'
135     * return how many ways go from the given Checkpoint to the last Checkpoint (of the Game)
136     */
137    int SpaceRaceController::rekSimulationCheckpointsReached(RaceCheckPoint* currentCheckpoint, std::map<RaceCheckPoint*, int>* zaehler)
138    {
139
140        if (currentCheckpoint->isLast())
141        {// last point reached
142            orxout() << "last one" << endl;
143            (*zaehler)[currentCheckpoint] += 1;
144            return 1; // 1 Way form the last point to this one
145        }
146        else
147        {
148            int numberOfWays = 0; // counts number of ways from this Point to the last point
149            for (std::set<int>::iterator it = currentCheckpoint->getNextCheckpoints().begin(); it!= currentCheckpoint->getNextCheckpoints().end(); ++it)
150            {
151                if(currentCheckpoint==findCheckpoint(*it)){
152                    orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
153                    continue;
154                }
155                for (std::set<int>::iterator a = currentCheckpoint->getNextCheckpoints().begin(); a!= currentCheckpoint->getNextCheckpoints().end(); ++a){
156                    orxout() << "Nextcheckpoints: "<<(*a) << endl;
157                }
158                orxout() << "currentCheck; " << currentCheckpoint->getCheckpointIndex() << "findCheck; " << findCheckpoint(*it)->getCheckpointIndex() << endl;
159                numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
160            }
161            (*zaehler)[currentCheckpoint] += numberOfWays;
162            return numberOfWays; // returns the number of ways from this point to the last one
163        }
164    }
165
166    //-------------------------------------
167    // functions for dynamic Way-search
168
169    int SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
170    {
171        if (this->getControllableEntity() != NULL)
172        {
173            return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length();
174        }
175        return -1;
176    }
177
178    /*
179     * called by: 'tick' or  'adjustNextPoint'
180     * returns the next Checkpoint which the shortest way contains
181     */
182    RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint)
183    {
184        int distances[] =
185        {   -1, -1, -1};
186        int temp_i = 0;
187        for (std::set<int>::iterator it =raceCheckpoint->getNextCheckpoints().begin(); it!= raceCheckpoint->getNextCheckpoints().end(); ++it)
188        {
189            distances[temp_i] = recCalculateDistance(findCheckpoint(*it), this->getControllableEntity()->getPosition());
190            temp_i++;
191        }
192        if (distances[0] > distances[1] && distances[1] != -1)
193        {
194            if (distances[2] < distances[1] && distances[2] != -1)
195            {
196                return findCheckpoint(*raceCheckpoint->getNextCheckpoints().end()); // return checkpoint with ID of raceCheckpoint->getNextCheckpoints() [2]
197            }
198            else
199            {
200                std::set<int>::iterator temp = raceCheckpoint->getNextCheckpoints().begin();
201                return findCheckpoint(*(++temp)); // return [1]
202            }
203        }
204        else
205        {
206            if (distances[2] < distances[0] && distances[2] != -1)
207            {
208                return findCheckpoint(*raceCheckpoint->getNextCheckpoints().end()); // return [2]
209            }
210            else
211            {
212                return findCheckpoint(*raceCheckpoint->getNextCheckpoints().begin()); // return [0]
213            }
214        }
215    }
216
217    /*
218     * called from 'nextPointFind'
219     * returns the distance between "currentPosition" and the next static checkpoint that can be reached from "currentCheckPoint"
220     */
221    int SpaceRaceController::recCalculateDistance(RaceCheckPoint* currentCheckPoint, Vector3 currentPosition)
222    {
223        // find: looks if the currentCheckPoint is a staticCheckPoint (staticCheckPoint is the same as: static Point)
224        if (std::find(staticRacePoints_.begin(), staticRacePoints_.end(), currentCheckPoint) != staticRacePoints_.end())
225        {
226            return (currentCheckPoint->getPosition() - currentPosition).length();
227        }
228        else
229        {
230            int minimum = std::numeric_limits<int>::max();
231            for (std::set<int>::iterator it = currentCheckPoint->getNextCheckpoints().begin(); it!= currentCheckPoint->getNextCheckpoints().end(); ++it)
232            {
233                int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
234
235                minimum= std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
236                // minimum of distanz from 'currentPosition' to the next static Checkpoint
237            }
238            return minimum;
239        }
240    }
241
242    /*called by 'tick'
243     *adjust chosen way of the Spaceship every "AdjustDistance" because spaceship could be displaced through an other one
244     */
245    RaceCheckPoint* SpaceRaceController::adjustNextPoint()
246    {
247        if (currentRaceCheckpoint_ == NULL) // no Adjust possible
248
249        {
250            return nextRaceCheckpoint_;
251        }
252        if ((currentRaceCheckpoint_->getNextCheckpoints()).size() == 1) // no Adjust possible
253
254        {
255            return nextRaceCheckpoint_;
256        }
257
258        //Adjust possible
259
260        return nextPointFind(currentRaceCheckpoint_);
261    }
262
263    RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
264    {
265        for (size_t i = 0; i < this->checkpoints_.size(); ++i)
266        if (this->checkpoints_[i]->getCheckpointIndex() == index)
267        return this->checkpoints_[i];
268        return NULL;
269    }
270
271    RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , Vector3 virtualCheckPointPosition )
272    {
273        RaceCheckPoint* newTempRaceCheckPoint;
274        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it){
275            newTempRaceCheckPoint = new RaceCheckPoint((*it));
276        }
277        newTempRaceCheckPoint->setPosition(virtualCheckPointPosition);
278        newTempRaceCheckPoint->setCheckpointIndex(virtualCheckPointIndex);
279        newTempRaceCheckPoint->setLast(false);
280        newTempRaceCheckPoint->setNextCheckpointsAsVector3(Vector3(indexFollowingCheckPoint,-1,-1));
281
282        Vector3 temp = previousCheckpoint->getNextCheckpointsAsVector3();
283        checkpoints_.insert(checkpoints_.end(), newTempRaceCheckPoint);
284        int positionInNextCheckPoint;
285        for (int i = 0; i <3; i++)
286        {
287            if(previousCheckpoint->getNextCheckpointsAsVector3()[i]==indexFollowingCheckPoint)
288            positionInNextCheckPoint=i;
289        }
290        switch(positionInNextCheckPoint)
291        {
292            case 0: temp.x=virtualCheckPointIndex; break;
293            case 1: temp.y=virtualCheckPointIndex; break;
294            case 2: temp.z=virtualCheckPointIndex; break;
295        }
296        previousCheckpoint->setNextCheckpointsAsVector3(temp);
297        virtualCheckPointIndex--;
298        OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp");
299        return newTempRaceCheckPoint;
300    }
301
302    SpaceRaceController::~SpaceRaceController()
303    {
304        for (int i =-1; i>virtualCheckPointIndex; i--)
305        {
306            delete findCheckpoint(i);
307        }
308    }
309
310    void SpaceRaceController::tick(float dt)
311    {
312        if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
313        {   orxout()<<this->getControllableEntity()<< " in tick"<<endl; return;}
314        //FOR virtual Checkpoints
315        if(nextRaceCheckpoint_->getCheckpointIndex() < 0)
316        {
317            if( distanceSpaceshipToCheckPoint(nextRaceCheckpoint_) < 30)
318            {
319                currentRaceCheckpoint_=nextRaceCheckpoint_;
320                nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
321                lastPositionSpaceship=this->getControllableEntity()->getPosition();
322            }
323        }
324
325        if (nextRaceCheckpoint_->playerWasHere(this->getControllableEntity()->getPlayer()))
326        {//Checkpoint erreicht
327            currentRaceCheckpoint_=nextRaceCheckpoint_;
328            OrxAssert(nextRaceCheckpoint_, "next race checkpoint undefined");
329            nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
330            lastPositionSpaceship=this->getControllableEntity()->getPosition();
331        }
332        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
333        {
334            nextRaceCheckpoint_ = adjustNextPoint();
335            lastPositionSpaceship=this->getControllableEntity()->getPosition();
336        }
337        //TODO: korrigieren!
338
339        else if((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt< MINDISTANCE )
340        {
341            this->moveToPosition(Vector3(rnd()*100,rnd()*100,rnd()*100));
342            this->spin();
343            //orxout(user_status) << "Mindistance reached" << std::endl;
344            return;
345        }
346        //orxout(user_status) << "dt= " << dt << ";  distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl;
347        lastPositionSpaceship=this->getControllableEntity()->getPosition();
348        this->moveToPosition(nextRaceCheckpoint_->getPosition());
349    }
350
351    // True if a coordinate of 'pointToPoint' is smaller then the corresponding coordinate of 'groesse'
352    bool SpaceRaceController::vergleicheQuader(Vector3 pointToPoint, Vector3 groesse)
353    {
354        if(abs(pointToPoint.x)<groesse.x)
355        return true;
356        if(abs(pointToPoint.y)<groesse.y)
357        return true;
358        if(abs(pointToPoint.z)<groesse.z)
359        return true;
360
361    }
362
363    bool SpaceRaceController::directLinePossible(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2,std::vector<StaticEntity*> allObjects){
364
365        Vector3 cP1ToCP2=(racepoint2->getPosition()-racepoint1->getPosition()) / (racepoint2->getPosition()-racepoint1->getPosition()).length(); //unit Vector
366        Vector3 centerCP1=racepoint1->getPosition();
367        btVector3 positionObject;
368        btScalar radiusObject;
369
370        for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it!=allObjects.end(); ++it){
371            for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++){
372                btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
373                if(currentShape == NULL)
374                    continue;
375
376                currentShape->getBoundingSphere(positionObject,radiusObject);
377                Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
378                if((powf((cP1ToCP2.dotProduct(centerCP1-positionObjectNonBT)),2)-(centerCP1-positionObjectNonBT).dotProduct(centerCP1-positionObjectNonBT)+powf(radiusObject, 2))>0){
379                    return false;
380                }
381
382            }
383        }
384        return true;
385
386    }
387
388    void SpaceRaceController::computeVirtualCheckpoint(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2,std::vector<StaticEntity*> allObjects){
389                Vector3 cP1ToCP2=(racepoint2->getPosition()-racepoint1->getPosition()) / (racepoint2->getPosition()-racepoint1->getPosition()).length(); //unit Vector
390                Vector3 centerCP1=racepoint1->getPosition();
391                btVector3 positionObject;
392                btScalar radiusObject;
393
394                for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it!=allObjects.end(); ++it){
395                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++){
396                        btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
397                        if(currentShape == NULL)
398                            continue;
399
400                        currentShape->getBoundingSphere(positionObject,radiusObject);
401                        Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
402                        if((powf((cP1ToCP2.dotProduct(centerCP1-positionObjectNonBT)),2)-(centerCP1-positionObjectNonBT).dotProduct(centerCP1-positionObjectNonBT)+powf(radiusObject, 2))>0){
403                            Vector3 zufall;
404                            Vector3 objectmiddle=positionObjectNonBT;
405                            do{
406                                      zufall=Vector3(rnd(),rnd(),rnd());//random
407                            }while((zufall.crossProduct(objectmiddle-racepoint1->getPosition())).length()==0);
408
409
410                            Vector3 normalvec=zufall.crossProduct(objectmiddle-racepoint1->getPosition());
411                            // a'/b'=a/b => a' =b'*a/b
412                            float laengeNormalvec=(objectmiddle-racepoint1->getPosition()).length()/sqrt((objectmiddle-racepoint1->getPosition()).squaredLength()-radiusObject*radiusObject)*radiusObject;
413                            RaceCheckPoint* newVirtualCheckpoint=addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), objectmiddle+normalvec/normalvec.length()*laengeNormalvec);
414                            //placeVirtualCheckpoints(newVirtualCheckpoint, racepoint2);
415                            return;
416                        }
417
418                    }
419                }
420
421    }
422
423
424
425    void SpaceRaceController::placeVirtualCheckpoints(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2)
426    {
427        Vector3 point1 = racepoint1->getPosition();
428        Vector3 point2 = racepoint2->getPosition();
429        std::vector<StaticEntity*> problematicObjects;
430
431        for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
432        {
433
434            if (dynamic_cast<RaceCheckPoint*>(*it)!=NULL)
435            {   continue;} // does not work jet
436
437            problematicObjects.insert(problematicObjects.end(), *it);
438            //it->getScale3D();// vector fuer halbe wuerfellaenge
439        }
440
441        if(!directLinePossible(racepoint1, racepoint2, problematicObjects)) {
442            computeVirtualCheckpoint(racepoint1, racepoint2, problematicObjects);
443        }
444
445
446//
447//        do{
448//            zufall=Vector3(rnd(),rnd(),rnd());//random
449//        }while((zufall.crossProduct(objectmiddle-racepoint1->getPosition())).length()==0);
450//
451//        Vector3 normalvec=zufall.crossProduct(objectmiddle-racepoint1->getPosition());
452//        // a'/b'=a/b => a' =b'*a/b
453//        float laengeNormalvec=(objectmiddle-racepoint1->getPosition()).length()/sqrt((objectmiddle-racepoint1->getPosition()).squaredLength()-radius*radius)*radius;
454//        addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), objectmiddle+normalvec/normalvec.length()*laengeNormalvec);
455
456//        Vector3 richtungen [6];
457//        richtungen[0]= Vector3(1,0,0);
458//        richtungen[1]= Vector3(-1,0,0);
459//        richtungen[2]= Vector3(0,1,0);
460//        richtungen[3]= Vector3(0,-1,0);
461//        richtungen[4]= Vector3(0,0,1);
462//        richtungen[5]= Vector3(0,0,-1);
463//
464//        for (int i = 0; i< 6; i++)
465//        {
466//            const int STEPS=100;
467//            const float PHI=1.1;
468//            bool collision=false;
469//
470//            for (int j =0; j<STEPS; j++)
471//            {
472//                Vector3 tempPosition=(point1 - (point2-point1+richtungen[i]*PHI)*(float)j/STEPS);
473//                for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
474//                {
475//                    btVector3 positionObject;
476//                    btScalar radiusObject;
477//                    if((*it)==NULL)
478//                    {   orxout()<<"Problempoint 1.1"<<endl; continue;}
479//                    //TODO: Probably it points on a wrong object
480//                    for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
481//                    {
482//                        if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
483//                        {    continue;}
484//
485//                        orxout()<<"Problempoint 2.1"<<endl;
486//                        (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
487//                        Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
488//                        if (((tempPosition - positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
489//                        {
490//                            collision=true; break;
491//                        }
492//                    }
493//                    if(collision) break;
494//                }
495//                if(collision)break;
496//            }
497//            if(collision) continue;
498//            // no collision => possible Way
499//            for (float j =0; j<STEPS; j++)
500//            {
501//                Vector3 possiblePosition=(point1 - (point2-point1+richtungen[i]*PHI)*j/STEPS);
502//                collision=false;
503//                for(int ij=0; ij<STEPS; j++)
504//                {
505//                    Vector3 tempPosition=(possiblePosition - (point2-possiblePosition)*(float)ij/STEPS);
506//                    for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
507//                    {
508//                        btVector3 positionObject;
509//                        btScalar radiusObject;
510//                        if((*it)==NULL)
511//                        {   orxout()<<"Problempoint 1"<<endl; continue;}
512//                        for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
513//                        {
514//                            if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
515//                            {   orxout()<<"Problempoint 2.2"<<endl; continue;}
516//                            (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
517//                            Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
518//                            if (((tempPosition-positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
519//                            {
520//                                collision=true; break;
521//                            }
522//                        }
523//                        if(collision) break;
524//                    }
525//                    if(collision)break;
526//                    //addVirtualCheckPoint(racepoint1, racepoint2->getCheckpointIndex(), possiblePosition);
527//                    return;
528//                }
529//
530//            }
531//        }
532
533    }
534}
Note: See TracBrowser for help on using the repository browser.