Changeset 9229
- Timestamp:
- May 23, 2012, 1:07:29 PM (13 years ago)
- Location:
- code/branches/presentation2012
- Files:
-
- 10 edited
- 30 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012
-
code/branches/presentation2012/data/levels/emptyLevel.oxw
r9016 r9229 23 23 <?lua include("includes/notifications.oxi") ?> 24 24 25 25 26 <Scene 26 27 ambientlight = "0.8, 0.8, 0.8" … … 30 31 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 31 32 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 /> 32 33 34 33 35 </Scene> 34 36 </Level> -
code/branches/presentation2012/data/levels/portals.oxw
r9016 r9229 29 29 <PortalEndPoint> 30 30 <attached> 31 < Billboard material="Portals/Default"/>31 <Model mesh="Spacegate.mesh" yaw="90"/> 32 32 </attached> 33 33 </PortalEndPoint> -
code/branches/presentation2012/data/levels/teamDeathMatch.oxw
r9016 r9229 25 25 <Scene 26 26 ambientlight = "0.7, 0.6, 0.6" 27 skybox = "Orxonox/ skypanoramagen1"27 skybox = "Orxonox/creeper1" 28 28 > 29 29 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" /> -
code/branches/presentation2012/data/levels/templates/spaceshipPirate.oxt
r8858 r9229 35 35 angularDamping = 0.9999999 36 36 > 37 37 38 <engines> 38 39 <MultiStateEngine position=" 0, 0, 0" template=spaceshippirateengine /> 39 40 </engines> 40 41 <attached> 41 <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale= 4mesh="pirate.mesh" />42 <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=20 mesh="pirate.mesh" /> 42 43 <BlinkingBillboard position=" 12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 /> 43 44 <BlinkingBillboard position="-12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 phase="90"/> -
code/branches/presentation2012/data/levels/theTimeMachine.oxw
r9016 r9229 57 57 ?> 58 58 </SpaceShip> 59 </Template> 60 61 <Template name=spaceshipassffengine baseclass=MultiStateEngine> 62 <MultiStateEngine 63 boostfactor = 2 64 65 speedfront = 150 66 speedback = 50 67 speedleftright = 50 68 speedupdown = 50 69 70 defEngineSndNormal = "sounds/Engine_low.ogg" 71 defEngineSndBoost = "sounds/Engine_high.ogg" 72 73 accelerationfront = 500 74 accelerationbrake = 500 75 accelerationback = 125 76 accelerationleftright = 125 77 accelerationupdown = 125 78 > 79 80 </MultiStateEngine> 59 81 </Template> 60 82 -
code/branches/presentation2012/src/modules/CMakeLists.txt
r8706 r9229 38 38 ADD_SUBDIRECTORY(weapons) 39 39 ADD_SUBDIRECTORY(docking) 40 ADD_SUBDIRECTORY(towerdefense) -
code/branches/presentation2012/src/orxonox/controllers/FormationController.cc
r9016 r9229 272 272 } 273 273 274 Vector2 coord = get2DView direction(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);274 Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 275 275 float distance = (target - this->getControllableEntity()->getPosition()).length(); 276 276 if(coord.x < 0.0001 && coord.y < 0.0001) 277 { 278 // if the ship reaches a direction very close to the direct one, set it to the direct one 279 Vector3 v_temp = this->getControllableEntity()->getPosition(); 280 Quaternion quat = v_temp.getRotationTo(target); 281 this->getControllableEntity()->rotate(quat); 282 } 277 283 278 284 if(this->state_ == FREE) … … 281 287 { 282 288 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 283 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);284 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);285 } 286 287 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())289 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * coord.x * 2); 290 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * coord.y * 2); 291 } 292 293 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength()) 288 294 { 289 295 this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance … … 297 303 if (this->target_ || distance > 10) 298 304 { 299 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);300 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);305 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * coord.x * 2); 306 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * coord.y * 2); 301 307 } 302 308 … … 310 316 311 317 if(this->state_ == SLAVE) 312 313 314 this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);315 this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);316 317 318 319 320 321 copyTargetOrientation();322 323 324 {//linear speed reduction325 326 327 328 329 330 331 332 318 { 319 320 this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * coord.x * 2); 321 this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * coord.y * 2); 322 323 if (distance < 300) 324 { 325 if (bHasTargetOrientation_) 326 { 327 copyTargetOrientation(); 328 } 329 if (distance < 100) 330 { //linear speed reduction 331 this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER); 332 333 } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER); 334 335 } else { 336 this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f); 337 } 338 } 333 339 334 340 if (distance < 10) … … 383 389 void FormationController::searchNewMaster() 384 390 { 385 if (this->state_==SLAVE) 391 if (this->state_==SLAVE) 386 392 return; 387 393 if (!this->getControllableEntity()) … … 394 400 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 395 401 { 396 402 397 403 //same team? 398 404 Gametype* gt=this->getGametype(); … … 479 485 bool left=true; 480 486 int i = 1; 481 487 482 488 for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++) 483 489 { … … 490 496 i++; 491 497 dest+=FORMATION_LENGTH*(orient*WorldEntity::BACK); 492 } 498 } 493 499 (*it)->setTargetOrientation(orient); 494 500 (*it)->setTargetPosition(pos); … … 599 605 600 606 if (this->state_==SLAVE) //become master of this formation 601 { 607 { 602 608 this->slaves_=this->myMaster_->slaves_; 603 609 this->myMaster_->slaves_.clear(); 604 610 this->myMaster_->state_=SLAVE; 605 611 this->myMaster_->myMaster_=this; 606 612 607 613 //delete myself in slavelist 608 614 std::vector<FormationController*>::iterator it2 = std::find(this->slaves_.begin(), this->slaves_.end(), this); … … 647 653 if (i>=slaves_.size()/2) break; //half the formation should attack. 648 654 } 649 } 655 } 650 656 651 657 … … 860 866 void FormationController::setTargetOrientation(const Quaternion& orient) 861 867 { 862 this->targetOrientation_=orient; 868 this->targetOrientation_=orient; 863 869 this->bHasTargetOrientation_=true; 864 870 } -
code/branches/presentation2012/src/orxonox/controllers/WaypointController.cc
r8891 r9229 62 62 void WaypointController::tick(float dt) 63 63 { 64 64 if (!this->isActive()) 65 65 return; 66 66 67 67 68 if (this->waypoints_.size() == 0 || !this->getControllableEntity()) 68 69 return; 69 70 71 70 72 if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_) 71 73 this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size(); 74 72 75 73 76 this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition()); -
code/branches/presentation2012/src/orxonox/worldentities/WorldEntity.cc
r8858 r9229 379 379 if (!object->notifyBeingAttached(this)) 380 380 return; 381 382 381 this->attachNode(object->node_); 383 382 this->children_.insert(object);
Note: See TracChangeset
for help on using the changeset viewer.