Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2012, 4:47:21 PM (12 years ago)
Author:
purgham
Message:

works but its not properly coded and Position of VirtualCheckpoint bad

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc

    r9512 r9513  
    6666        OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
    6767        checkpoints_=checkpoints;
    68         orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
     68        /*orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
    6969        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
    7070        {
     
    8484            orxout()<<endl<<endl;
    8585
    86         }//ausgabe
     86        }//ausgabe*/
    8787
    8888        for( std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it!=checkpoints.end(); ++it)
     
    9999                }
    100100            }
    101         }
     101        }/*
    102102        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
    103103        {
     
    118118
    119119        }//ausgabe
    120         orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
     120        orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;*/
    121121        staticRacePoints_ = findStaticCheckpoints(checkpoints);
    122122        // initialisation of currentRaceCheckpoint_
     
    128128            continue;
    129129        }
    130         orxout()<<"Die ANzahl der virtuellen CP betraegt: "<< (-i)-2<<endl;
     130        //orxout()<<"Die ANzahl der virtuellen CP betraegt: "<< (-i)-2<<endl;
    131131
    132132    }
     
    190190                if(currentCheckpoint==findCheckpoint(*it))
    191191                {
    192                     orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
     192                    //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
    193193                    continue;
    194194                }
     
    308308    RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , Vector3 virtualCheckPointPosition )
    309309    {
     310        orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;
    310311        RaceCheckPoint* newTempRaceCheckPoint;
    311312        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
     
    320321
    321322        Vector3 temp = previousCheckpoint->getVirtualNextCheckpointsAsVector3();
    322         orxout()<<"temp bei 0: ="<< temp.x<< temp.y<< temp.z<<endl;
     323        //orxout()<<"temp bei 0: ="<< temp.x<< temp.y<< temp.z<<endl;
    323324        checkpoints_.insert(checkpoints_.end(), newTempRaceCheckPoint);
    324325        int positionInNextCheckPoint;
     
    336337        previousCheckpoint->setNextVirtualCheckpointsAsVector3(temp); //Existiert internes Problem bei negativen index fueer next Checkpoint
    337338        virtualCheckPointIndex--;
    338         orxout()<<"temp bei 1: ="<< temp.x<< temp.y<< temp.z<<endl;
    339         orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;
     339        //orxout()<<"temp bei 1: ="<< temp.x<< temp.y<< temp.z<<endl;
     340        //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;
    340341        //OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp");
    341342        /*orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" :       "<<temp.x<<", "<<temp.y<<", "<<temp.z<<";       ";
     
    366367                nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
    367368                lastPositionSpaceship=this->getControllableEntity()->getPosition();
    368                 orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
     369                //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
    369370            }
    370371        }
     
    377378            nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
    378379            lastPositionSpaceship=this->getControllableEntity()->getPosition();
    379             orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
     380            //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
    380381        }
    381382        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
     
    497498        if(!directLinePossible(racepoint1, racepoint2, problematicObjects))
    498499        {
    499             orxout()<<"From "<<racepoint1->getCheckpointIndex()<<" to "<<racepoint2->getCheckpointIndex()<<"produces: "<< virtualCheckPointIndex<<endl;
     500            //orxout()<<"From "<<racepoint1->getCheckpointIndex()<<" to "<<racepoint2->getCheckpointIndex()<<"produces: "<< virtualCheckPointIndex<<endl;
    500501            computeVirtualCheckpoint(racepoint1, racepoint2, problematicObjects);
    501502        }
Note: See TracChangeset for help on using the changeset viewer.