Changeset 11913 for code/branches
- Timestamp:
- Apr 26, 2018, 4:05:17 PM (7 years ago)
- Location:
- code/branches/RacingBots_FS18
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
r11912 r11913 21 21 22 22 include("templates/spaceshipAssff.oxt") 23 include("templates/ pickupRepresentationTemplates.oxt")23 include("templates/SpaceRaceTemplates.oxt") 24 24 25 25 ?> … … 245 245 </collisionShapes> 246 246 </RaceCheckPoint> 247 248 247 <Model mesh="cube.mesh" scale=2 position="3000,200,100"/> 248 <Model mesh="cube.mesh" scale=2 position="5000,100,500"/> 249 249 250 250 <RaceCheckPoint name="checkpoint2" yaw=90 pitch=90 position="3000,200,100" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1"> … … 261 261 262 262 263 <RaceCheckPoint name="checkpoint3" yaw=90 pitch=90 position="5000, 100,500" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">263 <RaceCheckPoint name="checkpoint3" yaw=90 pitch=90 position="5000,-100,500" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1"> 264 264 <attached> 265 265 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 287 287 288 288 289 <RaceCheckPoint name="checkpoint5" yaw=90 pitch=90 position="1 0000,-200,200" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">290 <attached> 291 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 292 </attached> 293 <collisionShapes> 294 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 295 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 296 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 297 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 298 </collisionShapes> 299 </RaceCheckPoint> 300 301 302 303 <RaceCheckPoint name="checkpoint6" yaw=90 pitch=90 position="13000, 200,400" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">304 <attached> 305 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 306 </attached> 307 <collisionShapes> 308 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 309 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 310 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 311 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 312 </collisionShapes> 313 </RaceCheckPoint> 314 315 316 317 <RaceCheckPoint name="checkpoint7" yaw=90 pitch=90 position="15 000,0,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">289 <RaceCheckPoint name="checkpoint5" yaw=90 pitch=90 position="11000,-200,200" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1"> 290 <attached> 291 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 292 </attached> 293 <collisionShapes> 294 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 295 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 296 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 297 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 298 </collisionShapes> 299 </RaceCheckPoint> 300 301 302 303 <RaceCheckPoint name="checkpoint6" yaw=90 pitch=90 position="13000,-50,400" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1"> 304 <attached> 305 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> 306 </attached> 307 <collisionShapes> 308 <BoxCollisionShape position="0,0,70" halfExtents="70, 10, 10" /> 309 <BoxCollisionShape position="0,0,-70" halfExtents="70, 10, 10" /> 310 <BoxCollisionShape position="70,0,0" halfExtents="10, 10, 70" /> 311 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 312 </collisionShapes> 313 </RaceCheckPoint> 314 315 316 317 <RaceCheckPoint name="checkpoint7" yaw=90 pitch=90 position="15500,0,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1"> 318 318 <attached> 319 319 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 406 406 407 407 408 <RaceCheckPoint name="checkpoint14" yaw=90 pitch=90 position="35000, 120,20" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="13" islast="false" nextcheckpoints="14,-1,-1">408 <RaceCheckPoint name="checkpoint14" yaw=90 pitch=90 position="35000,700,20" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="60" checkpointindex="13" islast="false" nextcheckpoints="14,-1,-1"> 409 409 <attached> 410 410 <Model position="0,0,0" scale="70" mesh="Checkpoint_InnerRing.mesh"/> … … 476 476 <BoxCollisionShape position="-70,0,0" halfExtents="10, 10, 70" /> 477 477 </collisionShapes> 478 </RaceCheckPoint> 478 </RaceCheckPoint> 479 479 480 480 <!-- the last checkpoint is bigger and red --> … … 489 489 <BoxCollisionShape position="-90,0,0" halfExtents="13, 13, 90" /> 490 490 </collisionShapes> 491 </RaceCheckPoint> 491 </RaceCheckPoint> 492 492 493 493 … … 532 532 <!-- ---------------------PickUps---------------------- --> 533 533 534 <PickupSpawner pickup=smallshrinkpickup position="10000,-200,200" triggerDistance="60" respawnTime="10" maxSpawnedItems="10" scale="8"/>535 <PickupSpawner pickup=mediumboostpickup position="24000,-1 50,-80" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/>534 535 <PickupSpawner pickup=mediumboostpickup position="24000,-165,-80" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 536 536 <PickupSpawner pickup=smallboostpickup position="38000,-200,0" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 537 537 538 <PickupSpawner pickup=smallspeedpickup position="7000,-200,100" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 539 <PickupSpawner pickup=mediumshinkpickup position="16000,150,50" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 540 <PickupSpawner pickup=triplehealthspeedinvisibilitypickup position="41000,-300,100" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 538 <PickupSpawner pickup=smallspeedpickup position="9000,-150,150" triggerDistance="60" respawnTime="10" maxSpawnedItems="8" scale="10"/> 539 541 540 </Scene> 542 541 </Level> -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
r11860 r11913 125 125 { 126 126 engine->setActive(false); 127 engine->addSpeedMultiply(3.5f); 127 128 } 128 129 -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc
r11912 r11913 235 235 } 236 236 237 /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , const Vector3& virtualCheckPointPosition )238 {239 orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;240 RaceCheckPoint* newTempRaceCheckPoint;241 ObjectList<SpaceRaceManager> list;242 for (ObjectList<SpaceRaceManager>::iterator it = list.begin(); it!= list.end(); ++it)243 {244 newTempRaceCheckPoint = new RaceCheckPoint((*it));245 }246 newTempRaceCheckPoint->setVisible(false);247 newTempRaceCheckPoint->setPosition(virtualCheckPointPosition);248 newTempRaceCheckPoint->setCheckpointIndex(virtualCheckPointIndex);249 newTempRaceCheckPoint->setLast(false);250 newTempRaceCheckPoint->setNextVirtualCheckpointsAsVector3(Vector3(indexFollowingCheckPoint,-1,-1));251 252 Vector3 temp = previousCheckpoint->getVirtualNextCheckpointsAsVector3();253 //orxout()<<"temp bei 0: ="<< temp.x<< temp.y<< temp.z<<endl;254 checkpoints_.insert(checkpoints_.end(), newTempRaceCheckPoint);255 int positionInNextCheckPoint;256 for (int i = 0; i <3; i++)257 {258 if(previousCheckpoint->getVirtualNextCheckpointsAsVector3()[i] == indexFollowingCheckPoint)259 positionInNextCheckPoint=i;260 }261 switch(positionInNextCheckPoint)262 {263 case 0: temp.x=virtualCheckPointIndex; break;264 case 1: temp.y=virtualCheckPointIndex; break;265 case 2: temp.z=virtualCheckPointIndex; break;266 }267 previousCheckpoint->setNextVirtualCheckpointsAsVector3(temp); //Existiert internes Problem bei negativen index fueer next Checkpoint268 virtualCheckPointIndex--;269 //orxout()<<"temp bei 1: ="<< temp.x<< temp.y<< temp.z<<endl;270 //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;271 //OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp");272 orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" : "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; ";273 temp=previousCheckpoint->getNextCheckpointsAsVector3();274 orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<": "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; ";275 orxout()<<endl;276 return newTempRaceCheckPoint;277 }*/278 279 237 SpaceRaceController::~SpaceRaceController() 280 238 { … … 380 338 381 339 } 382 383 /*void SpaceRaceController::computeVirtualCheckpoint(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2, const std::vector<StaticEntity*>& allObjects)384 {385 Vector3 cP1ToCP2=(racepoint2->getPosition()-racepoint1->getPosition()) / (racepoint2->getPosition()-racepoint1->getPosition()).length(); //unit Vector386 Vector3 centerCP1=racepoint1->getPosition();387 btVector3 positionObject;388 btScalar radiusObject;389 390 for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)391 {392 for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != nullptr; everyShape++)393 {394 btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();395 if(currentShape == nullptr)396 continue;397 398 currentShape->getBoundingSphere(positionObject,radiusObject);399 Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());400 Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);401 402 if(norm_r_CP.length() == 0){403 Vector3 zufall;404 do{405 zufall=Vector3(rnd(),rnd(),rnd());//random406 }while((zufall.crossProduct(cP1ToCP2)).length() == 0);407 norm_r_CP=zufall.crossProduct(cP1ToCP2);408 }409 Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2);410 float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));411 float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));412 float distanz = std::max(distanzToCP1,distanzToCP2);413 //float distanz = 0.0f; //TEMPORARY414 Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();415 Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();416 if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )417 {418 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);419 }420 else421 {422 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);423 }424 return;425 }426 }427 428 }*/429 430 /*void SpaceRaceController::placeVirtualCheckpoints(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2)431 {432 Vector3 point1 = racepoint1->getPosition();433 Vector3 point2 = racepoint2->getPosition();434 std::vector<StaticEntity*> problematicObjects;435 436 ObjectList<StaticEntity> list;437 for (ObjectList<StaticEntity>::iterator it = list.begin(); it!= list.end(); ++it)438 {439 440 if (dynamic_cast<RaceCheckPoint*>(*it) != nullptr)441 {442 continue;443 } // does not work jet444 445 problematicObjects.insert(problematicObjects.end(), *it);446 //it->getScale3D();// vector fuer halbe wuerfellaenge447 }448 449 if(!directLinePossible(racepoint1, racepoint2, problematicObjects))450 {451 //orxout()<<"From "<<racepoint1->getCheckpointIndex()<<" to "<<racepoint2->getCheckpointIndex()<<"produces: "<< virtualCheckPointIndex<<endl;452 computeVirtualCheckpoint(racepoint1, racepoint2, problematicObjects);453 }454 455 //456 // do{457 // zufall=Vector3(rnd(),rnd(),rnd());//random458 // }while((zufall.crossProduct(objectmiddle-racepoint1->getPosition())).length()==0);459 //460 // Vector3 normalvec=zufall.crossProduct(objectmiddle-racepoint1->getPosition());461 // // a'/b'=a/b => a' =b'*a/b462 // float laengeNormalvec=(objectmiddle-racepoint1->getPosition()).length()/sqrt((objectmiddle-racepoint1->getPosition()).squaredLength()-radius*radius)*radius;463 // addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), objectmiddle+normalvec/normalvec.length()*laengeNormalvec);464 465 // Vector3 richtungen [6];466 // richtungen[0]= Vector3(1,0,0);467 // richtungen[1]= Vector3(-1,0,0);468 // richtungen[2]= Vector3(0,1,0);469 // richtungen[3]= Vector3(0,-1,0);470 // richtungen[4]= Vector3(0,0,1);471 // richtungen[5]= Vector3(0,0,-1);472 //473 // for (int i = 0; i< 6; i++)474 // {475 // const int STEPS=100;476 // const float PHI=1.1;477 // bool collision=false;478 //479 // for (int j =0; j<STEPS; j++)480 // {481 // Vector3 tempPosition=(point1 - (point2-point1+richtungen[i]*PHI)*(float)j/STEPS);482 // for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)483 // {484 // btVector3 positionObject;485 // btScalar radiusObject;486 // if((*it)==nullptr)487 // { orxout()<<"Problempoint 1.1"<<endl; continue;}488 // //TODO: Probably it points on a wrong object489 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=nullptr; everyShape++)490 // {491 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)492 // { continue;}493 //494 // orxout()<<"Problempoint 2.1"<<endl;495 // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);496 // Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());497 // if (((tempPosition - positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))498 // {499 // collision=true; break;500 // }501 // }502 // if(collision) break;503 // }504 // if(collision)break;505 // }506 // if(collision) continue;507 // // no collision => possible Way508 // for (float j =0; j<STEPS; j++)509 // {510 // Vector3 possiblePosition=(point1 - (point2-point1+richtungen[i]*PHI)*j/STEPS);511 // collision=false;512 // for(int ij=0; ij<STEPS; j++)513 // {514 // Vector3 tempPosition=(possiblePosition - (point2-possiblePosition)*(float)ij/STEPS);515 // for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)516 // {517 // btVector3 positionObject;518 // btScalar radiusObject;519 // if((*it)==nullptr)520 // { orxout()<<"Problempoint 1"<<endl; continue;}521 // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=nullptr; everyShape++)522 // {523 // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==nullptr)524 // { orxout()<<"Problempoint 2.2"<<endl; continue;}525 // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);526 // Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());527 // if (((tempPosition-positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))528 // {529 // collision=true; break;530 // }531 // }532 // if(collision) break;533 // }534 // if(collision)break;535 // //addVirtualCheckPoint(racepoint1, racepoint2->getCheckpointIndex(), possiblePosition);536 // return;537 // }538 //539 // }540 // }541 542 }*/543 340 } -
code/branches/RacingBots_FS18/src/orxonox/items/Engine.cc
r11860 r11913 68 68 69 69 this->speedAdd_ = 0.0f; 70 this->speedMultiply_ = 3.0f; //////////////////////////////////////////70 this->speedMultiply_ = 1.0f; ////////////////////////////////////////// 71 71 72 72 this->setConfigValues(); -
code/branches/RacingBots_FS18/src/orxonox/worldentities/pawns/SpaceShip.h
r11840 r11913 103 103 */ 104 104 virtual void moveFrontBack(const Vector2& value) 105 { this->steering_.z -= (0. 8)*value.x; }105 { this->steering_.z -= (0.6)*value.x; } 106 106 /** 107 107 @brief Move right or left.
Note: See TracChangeset
for help on using the changeset viewer.