Changeset 194 for code/branches/main_reto_vs05/src/run_manager.cc
- Timestamp:
- Nov 11, 2007, 2:24:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/main_reto_vs05/src/run_manager.cc
r193 r194 88 88 */ 89 89 RunManager::RunManager(OgreControl * ogre) 90 : ogre_(ogre), window_(ogre->getRenderWindow()), leftButtonDown_(false),90 : ogre_(ogre), window_(ogre->getRenderWindow()), //leftButtonDown_(false), 91 91 statsOn_(true), screenShotCounter_(0), timeUntilNextToggle_(0), 92 92 filtering_(TFO_BILINEAR), aniso_(1), sceneDetailIndex_(0), … … 109 109 bulletManager_ = new BulletManager(sceneMgr_); 110 110 WeaponManager::loadWeapons(); 111 112 // TODO: Use STL to make life easier. But it works this way too..113 /*bullets_ = new Bullet*[10];114 bulletsIndex_ = 0;115 bulletsSize_ = 10;*/116 111 117 112 … … 220 215 221 216 WeaponManager::destroyWeapons(); 222 223 // clean up the bullet list224 /*for (int i = 0; i < bulletsIndex_; i++)225 delete bullets_[i];226 delete bullets_;*/227 217 } 228 218 … … 256 246 bulletManager_->tick(time, deltaTime); 257 247 258 /*for (int i = 0; i < bulletsIndex_; i++)259 {260 bullets_[i]->node_->translate(bullets_[i]->speed_*deltaTime);261 bullets_[i]->node_->yaw(Degree(deltaTime*100));262 bullets_[i]->node_->roll(Degree(deltaTime*300));263 }*/264 248 265 249 // HUMAN INTERFACE … … 366 350 else 367 351 playerShip_->setYThrust(0); 352 353 if (keyboard_->isKeyDown(KC_G)) 354 playerShip_->getMainWeapon()->addAction(WeaponManager::RELOAD); 368 355 369 356 if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) ) … … 457 444 const MouseState &ms = mouse_->getMouseState(); 458 445 459 // This is a 'hack' to show some flying barrels.. 460 // Usually, the Bullet created by the ship should be managed 461 // by the physics engine.. 462 if (ms.buttonDown(MB_Left) && !leftButtonDown_) 463 { 464 // Prevent continuous fire for the moment. 465 leftButtonDown_ = true; 466 467 playerShip_->fire(); 468 469 // let ship fire one shot with its only weapon (Barrels..) 470 /*Bullet *tempBullet = playerShip_->fire(); 471 472 // resize array if neccessary (double the size then) 473 if (bulletsIndex_ >= bulletsSize_) 474 { 475 // redimension the array 476 Bullet **tempArray = new Bullet*[2*bulletsSize_]; 477 for (int i = 0; i < bulletsSize_; i++) 478 tempArray[i] = bullets_[i]; 479 bulletsSize_ *= 2; 480 delete bullets_; 481 bullets_ = tempArray; 482 } 483 484 // add the bullet to the list 485 bullets_[bulletsIndex_++] = tempBullet;*/ 486 487 } 488 else if (!ms.buttons) 489 leftButtonDown_ = false; 490 491 // space ship steering. This should definitely be done in the steering object 492 // Simply give it the mouse movements. 446 if (ms.buttonDown(MB_Left)) 447 playerShip_->getMainWeapon()->primaryFireRequest(); 448 449 if (ms.buttonDown(MB_Right)) 450 playerShip_->getMainWeapon()->secondaryFireRequest(); 451 493 452 playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_)); 494 453 playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_)); 495 //playerShip_->mRootNode->pitch(Degree(-ms.Y.rel * 0.13), Ogre::Node::TransformSpace::TS_LOCAL);496 //playerShip_->mRootNode->yaw(Degree(-ms.X.rel * 0.13), Ogre::Node::TransformSpace::TS_PARENT);497 454 498 455 // keep rendering
Note: See TracChangeset
for help on using the changeset viewer.