Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4973 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons


Ignore:
Timestamp:
Aug 7, 2005, 10:54:07 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some more loadparams

Location:
orxonox/trunk/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/turret.cc

    r4969 r4973  
    2828#include "fast_factory.h"
    2929
     30CREATE_FACTORY(Turret);
    3031
    3132using namespace std;
     
    4041  : Weapon(weaponManager)
    4142{
    42   this->setClassID(CL_TURRET, "Turret");
     43  this->init();
    4344
    4445  this->loadModel("models/turret1.obj");
     46
     47
     48  this->setActionSound(WA_SHOOT, "sound/shot1.wav");
     49  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
     50  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
     51}
     52
     53
     54Turret::Turret(const TiXmlElement* root)
     55{
     56  this->init();
     57  this->loadParams(root);
     58}
     59
     60/**
     61 *  standard deconstructor
     62*/
     63Turret::~Turret ()
     64{
     65  // model will be deleted from WorldEntity-destructor
     66}
     67
     68void Turret::init()
     69{
     70  this->setClassID(CL_TURRET, "Turret");
    4571
    4672  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    6490  //this->minCharge = 2;
    6591
    66   this->setActionSound(WA_SHOOT, "sound/shot1.wav");
    67   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
    68   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
    6992
    7093  this->setProjectile(CL_TEST_BULLET);
    7194
     95
    7296  this->setEmissionPoint(1.684, 0.472, 0);
    7397  //this->getProjectileFactory()->prepare(100);
     98
     99
    74100}
    75101
     102void Turret::loadParams(const TiXmlElement* root)
     103{
     104  static_cast<Weapon*>(this)->loadParams(root);
    76105
    77 /**
    78  *  standard deconstructor
    79 */
    80 Turret::~Turret ()
    81 {
    82   // model will be deleted from WorldEntity-destructor
    83106}
    84107
  • orxonox/trunk/src/world_entities/weapons/turret.h

    r4964 r4973  
    1313  public:
    1414    Turret (WeaponManager* weaponManager);
     15    Turret(const TiXmlElement* root);
    1516    virtual ~Turret ();
     17
     18    void init();
     19    void loadParams(const TiXmlElement* root);
    1620
    1721    virtual void activate();
Note: See TracChangeset for help on using the changeset viewer.