Changeset 9522 for code/branches
- Timestamp:
- Dec 16, 2012, 4:02:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc
r9517 r9522 358 358 { 359 359 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 } 361 364 //FOR virtual Checkpoints 362 365 if(nextRaceCheckpoint_->getCheckpointIndex() < 0) … … 409 412 if(abs(pointToPoint.z) < groesse.z) 410 413 return true; 414 return false; 411 415 412 416 } … … 460 464 Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT); 461 465 462 if(norm_r_CP.length == 0){466 if(norm_r_CP.length() == 0){ 463 467 Vector3 zufall; 464 468 do{ … … 470 474 float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2)); 471 475 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; //TEMPORARY476 float distanz = std::max(distanzToCP1,distanzToCP2); 477 //float distanz = 0.0f; //TEMPORARY 474 478 Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length(); 475 479 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 { 477 482 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos); 478 }else{ 483 } 484 else 485 { 479 486 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg); 480 487 }
Note: See TracChangeset
for help on using the changeset viewer.