Changeset 267 for code/branches/main_reto/src/orxonox_ship.cc
- Timestamp:
- Nov 27, 2007, 3:02:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/main_reto/src/orxonox_ship.cc
r192 r267 26 26 */ 27 27 28 #include "OgreSceneManager.h" 28 #include "OgreMath.h" 29 #include "OgreVector3.h" 30 #include "OgreQuaternion.h" 29 31 #include "OgreSceneNode.h" 30 32 #include "OgreEntity.h" 31 #include "Ogre Vector3.h"32 #include "Ogre StringConverter.h"33 #include "OgreSceneManager.h" 34 #include "OgreParticleSystem.h" 33 35 34 36 #include "inertial_node.h" 37 #include "run_manager.h" 35 38 #include "weapon/bullet.h" 36 39 #include "weapon/bullet_manager.h" 37 #include "weapon/weapon_manager.h" 40 #include "weapon/weapon_station.h" 41 #include "weapon/base_weapon.h" 42 #include "weapon/barrel_gun.h" 43 #include "weapon/ammunition_dump.h" 38 44 39 45 #include "orxonox_ship.h" … … 65 71 * @param mNode The scene node which the ship will be attached to later. 66 72 */ 67 OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node, 68 BulletManager *bulletManager) 69 : sceneMgr_(sceneMgr), //currentSpeed_(Vector3(0, 0, 0)), 70 baseThrust_(1000), currentThrust_(Vector3::ZERO), 71 objectCounter_(0), bulletManager_(bulletManager)//, bulletSpeed_(400) 73 OrxonoxShip::OrxonoxShip(SceneNode *node) 74 : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()), 75 bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()), 76 baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0) 72 77 { 73 78 rootNode_ = new InertialNode(node, Vector3::ZERO); … … 83 88 if (mainWeapon_) 84 89 delete mainWeapon_; 90 if (railGunStation_) 91 delete railGunStation_; 85 92 if (rootNode_) 86 93 delete rootNode_; … … 110 117 111 118 // initialise weapon(s) 119 ammoDump_ = new AmmunitionDump(); 120 ammoDump_->setDumpSize("Barrel", 1000); 121 ammoDump_->store("Barrel", 420); 122 112 123 InertialNode *mainWeaponNode = rootNode_->createChildNode(); 113 mainWeapon_ = new WeaponManager(sceneMgr_, mainWeaponNode, 114 bulletManager_, 1); 115 mainWeapon_->addWeapon("Barrel Gun"); 124 mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_); 125 126 railGunStation_ = new WeaponStation(4); 127 railGunStation_->addWeapon(mainWeapon_); 128 railGunStation_->selectWeapon(0); 129 130 // create some nice effects 131 132 ParticleSystem *particles = RunManager::getSingletonPtr() 133 ->getSceneManagerPtr()->createParticleSystem("asdf", "Examples/Smoke"); 134 135 fishNode->getSceneNode()->attachObject(particles); 136 137 138 116 139 117 140 return true; … … 197 220 * @return Bullet containing speed and entity. 198 221 */ 199 void OrxonoxShip::fire() 200 { 201 mainWeapon_->primaryFireRequest(); 222 BaseWeapon* OrxonoxShip::getMainWeapon() 223 { 224 return mainWeapon_; 225 } 226 227 228 int OrxonoxShip::getAmmoStock() 229 { 230 return ammoDump_->getStockSize("Barrel"); 202 231 } 203 232
Note: See TracChangeset
for help on using the changeset viewer.