Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9522 for code


Ignore:
Timestamp:
Dec 16, 2012, 4:02:34 PM (12 years ago)
Author:
jo
Message:

Repairing the Compiler Errors.

File:
1 edited

Legend:

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

    r9517 r9522  
    358358    {
    359359        if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
    360         {   orxout()<<this->getControllableEntity()<< " in tick"<<endl; return;}
     360        {
     361            //orxout()<< this->getControllableEntity() << " in tick"<<endl;
     362            return;
     363        }
    361364        //FOR virtual Checkpoints
    362365        if(nextRaceCheckpoint_->getCheckpointIndex() < 0)
     
    409412        if(abs(pointToPoint.z) < groesse.z)
    410413            return true;
     414        return false;
    411415
    412416    }
     
    460464                                Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);
    461465
    462                                 if(norm_r_CP.length == 0){
     466                                if(norm_r_CP.length() == 0){
    463467                                        Vector3 zufall;
    464468                    do{
     
    470474                                float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
    471475                                float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
    472                                 //TODO float distanz=max(distanzToCP1,distanzToCP2);
    473                                 float distanz = 0.0f; //TEMPORARY
     476                float distanz = std::max(distanzToCP1,distanzToCP2);
     477                                //float distanz = 0.0f; //TEMPORARY
    474478                                Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();
    475479                                Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();
    476                                 if((newCheckpointPositionPos-centerCP1).length+(newCheckpointPositionPos-(centerCP1+cP1ToCP2)).length < (newCheckpointPositionNeg-centerCP1).length+(newCheckpointPositionNeg-(centerCP1+cP1ToCP2)).length){
     480                                if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )
     481                                {
    477482                                        RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);
    478                                 }else{
     483                                }
     484                                else
     485                                {
    479486                                        RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);
    480487                                }
Note: See TracChangeset for help on using the changeset viewer.