Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2007, 3:02:03 PM (16 years ago)
Author:
rgrieder
Message:
  • updated to current revision from Visual studio directory
  • hopefully working libraries with cmake
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/main_reto/src/orxonox_ship.cc

    r192 r267  
    2626 */
    2727
    28 #include "OgreSceneManager.h"
     28#include "OgreMath.h"
     29#include "OgreVector3.h"
     30#include "OgreQuaternion.h"
    2931#include "OgreSceneNode.h"
    3032#include "OgreEntity.h"
    31 #include "OgreVector3.h"
    32 #include "OgreStringConverter.h"
     33#include "OgreSceneManager.h"
     34#include "OgreParticleSystem.h"
    3335
    3436#include "inertial_node.h"
     37#include "run_manager.h"
    3538#include "weapon/bullet.h"
    3639#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"
    3844
    3945#include "orxonox_ship.h"
     
    6571  * @param mNode The scene node which the ship will be attached to later.
    6672  */
    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)
    7277  {
    7378    rootNode_ = new InertialNode(node, Vector3::ZERO);
     
    8388    if (mainWeapon_)
    8489      delete mainWeapon_;
     90    if (railGunStation_)
     91      delete railGunStation_;
    8592    if (rootNode_)
    8693      delete rootNode_;
     
    110117
    111118    // initialise weapon(s)
     119    ammoDump_ = new AmmunitionDump();
     120    ammoDump_->setDumpSize("Barrel", 1000);
     121    ammoDump_->store("Barrel", 420);
     122
    112123    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
    116139
    117140          return true;
     
    197220  * @return Bullet containing speed and entity.
    198221  */
    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");
    202231  }
    203232
Note: See TracChangeset for help on using the changeset viewer.