Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7337 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Apr 19, 2006, 12:24:20 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: simple useless stuff

Location:
trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/multi_player_world_data.cc

    r7193 r7337  
    213213        playable->toList(OM_GROUP_00);
    214214        playable->setAbsCoor(213.37, 57.71, -47.98);
    215         playable->setAbsDirPlay(Quaternion(M_PI, Vector(0.0, 1.0, 0.0)));
     215        playable->setStartDirection(Quaternion(M_PI, Vector(0.0, 1.0, 0.0)));
    216216      }
    217217    }
  • trunk/src/world_entities/creatures/md2_creature.cc

    r7221 r7337  
    8888  cannon->setName("BFG");
    8989
    90    this->getWeaponManager()->addWeapon(wpLeft, 1, 0);
    91    this->getWeaponManager()->addWeapon(wpRight,1 ,1);
    92 //   this->getWeaponManager()->addWeapon(cannon, 0, 6);
    93 
    94   //this->getWeaponManager()->addWeapon(turret, 3, 0);
    95 
    96   this->getWeaponManager()->changeWeaponConfig(0);
     90   this->getWeaponManager().addWeapon(wpLeft, 1, 0);
     91   this->getWeaponManager().addWeapon(wpRight,1 ,1);
     92//   this->getWeaponManager().addWeapon(cannon, 0, 6);
     93
     94  //this->getWeaponManager().addWeapon(turret, 3, 0);
     95
     96  this->getWeaponManager().changeWeaponConfig(0);
    9797}
    9898
     
    147147
    148148
    149   this->getWeaponManager()->setSlotCount(7);
    150 
    151   this->getWeaponManager()->setSlotPosition(0, Vector(-0.5, .2, -1.9));
    152   this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    153 
    154   this->getWeaponManager()->setSlotPosition(1, Vector(-0.5, .2, 1.9));
    155   this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    156 
    157   this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5));
    158   this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    159 
    160   this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5));
    161   this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    162 
    163   this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5));
    164   this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    165 
    166   this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5));
    167   this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     149  this->getWeaponManager().setSlotCount(7);
     150
     151  this->getWeaponManager().setSlotPosition(0, Vector(-0.5, .2, -1.9));
     152  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     153
     154  this->getWeaponManager().setSlotPosition(1, Vector(-0.5, .2, 1.9));
     155  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     156
     157  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     158  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     159
     160  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     161  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     162
     163  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     164  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     165
     166  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     167  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    168168//
    169    this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0));
    170    this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     169   this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     170   this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    171171   //
    172172
    173    this->cameraConnNode.addChild(this->getWeaponManager()->getFixedTarget());
    174   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
    175 
    176   this->getWeaponManager()->getFixedTarget()->setRelCoor(10,0,0);
     173   this->cameraConnNode.addChild(this->getWeaponManager().getFixedTarget());
     174  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
     175
     176  this->getWeaponManager().getFixedTarget()->setRelCoor(10,0,0);
    177177
    178178}
     
    181181void MD2Creature::enter()
    182182{
    183   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     183  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
    184184  this->attachCamera();
    185185
     
    188188void MD2Creature::leave()
    189189{
    190   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     190  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    191191
    192192
  • trunk/src/world_entities/creatures/md2_creature.h

    r7221 r7337  
    2424
    2525    virtual void loadParams(const TiXmlElement* root);
    26     virtual void setAbsDirPlay(const Quaternion& rot) {/* FIXME */};
     26    virtual void setStartDirection(const Quaternion& rot) {/* FIXME */};
    2727
    2828    virtual void enter();
  • trunk/src/world_entities/playable.cc

    r7193 r7337  
    3939
    4040Playable::Playable()
     41  : weaponMan(this)
    4142{
    4243  this->setClassID(CL_PLAYABLE, "Playable");
     
    4445
    4546  this->toList(OM_GROUP_01);
    46   this->weaponMan = new WeaponManager(this);
    4747
    4848  // the reference to the Current Player is NULL, because we dont have one at the beginning.
     
    6464Playable::~Playable()
    6565{
    66   delete this->weaponMan;
    67 
    6866  // THE DERIVED CLASS MUST UNSUBSCRIBE THE PLAYER THROUGH
    6967  // this->setPlayer(NULL);
     
    7775  WorldEntity::loadParams(root);
    7876
    79   LoadParam(root, "abs-dir", this, Playable, setAbsDirPlay);
     77  LoadParam(root, "abs-dir", this, Playable, setStartDirection);
    8078}
    8179
    8280void Playable::addWeapon(Weapon* weapon, int configID, int slotID)
    8381{
    84   this->weaponMan->addWeapon(weapon, configID, slotID);
     82  this->weaponMan.addWeapon(weapon, configID, slotID);
    8583
    8684  this->weaponConfigChanged();
     
    9088void Playable::removeWeapon(Weapon* weapon)
    9189{
    92   this->weaponMan->removeWeapon(weapon);
     90  this->weaponMan.removeWeapon(weapon);
    9391
    9492    this->weaponConfigChanged();
     
    9896void Playable::nextWeaponConfig()
    9997{
    100   this->weaponMan->nextWeaponConfig();
     98  this->weaponMan.nextWeaponConfig();
    10199    this->weaponConfigChanged();
    102100}
     
    105103void Playable::previousWeaponConfig()
    106104{
    107   this->weaponMan->previousWeaponConfig();
     105  this->weaponMan.previousWeaponConfig();
    108106    this->weaponConfigChanged();
    109107}
     
    259257{
    260258  if(powerUp->isA(CL_WEAPON_POWER_UP)) {
    261     return dynamic_cast<WeaponPowerUp*>(powerUp)->process(this->getWeaponManager());
     259    return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager());
    262260  }
    263261  else if(powerUp->isA(CL_PARAM_POWER_UP)) {
     
    305303void Playable::tick(float dt)
    306304{
    307   this->weaponMan->tick(dt);
     305  this->weaponMan.tick(dt);
    308306  if (this->bFire)
    309     weaponMan->fire();
     307    weaponMan.fire();
    310308}
    311309
  • trunk/src/world_entities/playable.h

    r7173 r7337  
    4141    void previousWeaponConfig();
    4242
    43     inline WeaponManager* getWeaponManager() const { return this->weaponMan; };
     43    inline WeaponManager& getWeaponManager() { return this->weaponMan; };
    4444    void weaponConfigChanged();
    4545
     
    6565
    6666
    67     virtual void setAbsDirPlay(const Quaternion& rot) = 0;
    68     void setAbsDirPlay(float angle, float dirX, float dirY, float dirZ) { this->setAbsDirPlay(Quaternion(angle, Vector(dirX, dirY, dirZ))); }
     67    //
     68    virtual void setStartDirection(const Quaternion& rot) = 0;
     69    void setStartDirection(float angle, float dirX, float dirY, float dirZ) { this->setStartDirection(Quaternion(angle, Vector(dirX, dirY, dirZ))); }
    6970
    7071    inline void setScore( int score ) { this->score = score; }
     
    8182
    8283  private:
    83     WeaponManager*        weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
     84    WeaponManager         weaponMan;          //!< the weapon manager: managing a list of weapon to wepaon-slot mapping
    8485    std::list<int>        events;             //!< A list of Events, that are captured for this playable
    8586
  • trunk/src/world_entities/player.cc

    r6998 r7337  
    7676      this->playable = playable;
    7777      this->hud.setEnergyWidget(this->playable->getHealthWidget());
    78       this->hud.setWeaponManager(this->playable->getWeaponManager());
     78      this->hud.setWeaponManager(&this->playable->getWeaponManager());
    7979
    8080      this->playable->setPlayer(this);
  • trunk/src/world_entities/space_ships/helicopter.cc

    r7221 r7337  
    9494  this->addWeapon(cannon, 0, 6);
    9595
    96   this->getWeaponManager()->changeWeaponConfig(1);
    97   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     96  this->getWeaponManager().changeWeaponConfig(1);
     97  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9898}
    9999
     
    161161  registerEvent(EV_MOUSE_MOTION);
    162162
    163   this->getWeaponManager()->setSlotCount(7);
    164 
    165   this->getWeaponManager()->setSlotPosition(0, Vector(0.0, .1, -1.0));
    166   this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    167 
    168   this->getWeaponManager()->setSlotPosition(1, Vector(0.0, .1, 1.0));
    169   this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    170 
    171   this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5));
    172   this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    173 
    174   this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5));
    175   this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    176 
    177   this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5));
    178   this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    179 
    180   this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5));
    181   this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    182 
    183   this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0));
    184   this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    185 
    186   this->getWeaponManager()->getFixedTarget()->setParent(&(this->cameraNode));
    187   this->getWeaponManager()->getFixedTarget()->setRelCoor(0,0,0);
    188 
    189   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     163  this->getWeaponManager().setSlotCount(7);
     164
     165  this->getWeaponManager().setSlotPosition(0, Vector(0.0, .1, -1.0));
     166  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     167
     168  this->getWeaponManager().setSlotPosition(1, Vector(0.0, .1, 1.0));
     169  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     170
     171  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     172  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     173
     174  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     175  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     176
     177  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     178  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     179
     180  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     181  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     182
     183  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     184  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     185
     186  this->getWeaponManager().getFixedTarget()->setParent(&(this->cameraNode));
     187  this->getWeaponManager().getFixedTarget()->setRelCoor(0,0,0);
     188
     189  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    190190
    191191}
     
    202202void Helicopter::enter()
    203203{
    204   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
    205   State::getCameraNode()->setParentSoft(this->getWeaponManager()->getFixedTarget());
    206   State::getCameraTargetNode()->setParentSoft(this->getWeaponManager()->getFixedTarget());
     204  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
     205  State::getCameraNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
     206  State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
    207207}
    208208
    209209void Helicopter::leave()
    210210{
    211   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     211  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    212212  this->detachCamera();
    213213
  • trunk/src/world_entities/space_ships/helicopter.h

    r7221 r7337  
    2222
    2323    virtual void loadParams(const TiXmlElement* root);
    24     virtual void setAbsDirPlay(const Quaternion& rot){/* FIXME */};
     24    virtual void setStartDirection(const Quaternion& rot){/* FIXME */};
    2525
    2626    virtual void enter();
  • trunk/src/world_entities/space_ships/hover.cc

    r7327 r7337  
    8686  this->addWeapon(cannon, 0, 2);
    8787
    88   this->getWeaponManager()->changeWeaponConfig(1);
    89   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     88  this->getWeaponManager().changeWeaponConfig(1);
     89  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9090
    9191  this->loadModel("models/ships/hoverglider_mainbody.obj");
     
    138138  this->rotorNodeRight.setRelCoor(0, 1.0, 2.3);
    139139
    140   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     140  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    141141
    142142
     
    155155
    156156  // WEAPON_MANAGER configuration
    157   this->getWeaponManager()->setSlotCount(5);
    158 
    159   this->getWeaponManager()->setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);
    160   this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    161 
    162   this->getWeaponManager()->setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);
    163   this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    164 
    165   this->getWeaponManager()->setSlotPosition(2, Vector(-1.63, .809, -.003));
    166   this->getWeaponManager()->setSlotCapability(2, WTYPE_HEAVY);
     157  this->getWeaponManager().setSlotCount(5);
     158
     159  this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);
     160  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     161
     162  this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);
     163  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     164
     165  this->getWeaponManager().setSlotPosition(2, Vector(-1.63, .809, -.003));
     166  this->getWeaponManager().setSlotCapability(2, WTYPE_HEAVY);
    167167
    168168  /// TODO: THESE ARE TOO MUCH
    169   this->getWeaponManager()->setSlotPosition(3, Vector(-1.63, .678, -.652));
    170   this->getWeaponManager()->setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));
    171 
    172   this->getWeaponManager()->setSlotPosition(4, Vector(-1.63, .678, .652));
    173   this->getWeaponManager()->setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));
     169  this->getWeaponManager().setSlotPosition(3, Vector(-1.63, .678, -.652));
     170  this->getWeaponManager().setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));
     171
     172  this->getWeaponManager().setSlotPosition(4, Vector(-1.63, .678, .652));
     173  this->getWeaponManager().setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));
    174174
    175175  this->cameraNode.setRelCoor(1,5,0);
    176   this->getWeaponManager()->getFixedTarget()->setParent(&this->cameraNode);
    177   this->getWeaponManager()->getFixedTarget()->setRelCoor(1000,0,0);
     176  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
     177  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    178178}
    179179
     
    190190void Hover::enter()
    191191{
    192   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     192  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
    193193
    194194  State::getCameraNode()->setParentSoft(&this->cameraNode);
     
    199199void Hover::leave()
    200200{
    201   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     201  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    202202  this->detachCamera();
    203203
  • trunk/src/world_entities/space_ships/hover.h

    r7221 r7337  
    1919
    2020    virtual void loadParams(const TiXmlElement* root);
    21     virtual void setAbsDirPlay(const Quaternion& rot) {/* FIXME */};
     21    virtual void setStartDirection(const Quaternion& rot) {/* FIXME */};
    2222
    2323    virtual void enter();
  • trunk/src/world_entities/space_ships/space_ship.cc

    r7221 r7337  
    136136  //this->addWeapon(cannon, 0, 6);
    137137
    138   this->getWeaponManager()->changeWeaponConfig(1);
     138  this->getWeaponManager().changeWeaponConfig(1);
    139139
    140140  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
     
    183183  registerEvent(EV_MOUSE_MOTION);
    184184
    185   this->getWeaponManager()->setSlotCount(7);
    186 
    187   this->getWeaponManager()->setSlotPosition(0, Vector(-2.6, .1, -3.0));
    188   this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    189 
    190   this->getWeaponManager()->setSlotPosition(1, Vector(-2.6, .1, 3.0));
    191   this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    192 
    193   this->getWeaponManager()->setSlotPosition(2, Vector(-1.5, .5, -.5));
    194   this->getWeaponManager()->setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    195 
    196   this->getWeaponManager()->setSlotPosition(3, Vector(-1.5, .5, .5));
    197   this->getWeaponManager()->setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    198 
    199   this->getWeaponManager()->setSlotPosition(4, Vector(-1.5, -.5, .5));
    200   this->getWeaponManager()->setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    201 
    202   this->getWeaponManager()->setSlotPosition(5, Vector(-1.5, -.5, -.5));
    203   this->getWeaponManager()->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     185  this->getWeaponManager().setSlotCount(7);
     186
     187  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
     188  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     189
     190  this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
     191  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     192
     193  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     194  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     195
     196  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     197  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     198
     199  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     200  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     201
     202  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     203  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    204204//
    205    this->getWeaponManager()->setSlotPosition(6, Vector(-1, 0.0, 0));
    206    this->getWeaponManager()->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     205   this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     206   this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    207207   //
    208 //   this->getWeaponManager()->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
    209 //   this->getWeaponManager()->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
     208//   this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
     209//   this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
    210210//
    211 //   this->getWeaponManager()->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
    212 //   this->getWeaponManager()->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
    213 
    214   this->getWeaponManager()->getFixedTarget()->setParent(this);
    215   this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
    216 
    217   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     211//   this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
     212//   this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
     213
     214  this->getWeaponManager().getFixedTarget()->setParent(this);
     215  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
     216
     217  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    218218
    219219  this->burstEmitter = new DotEmitter(200, 0.0, .01);
     
    248248}
    249249
    250 void SpaceShip::setAbsDirPlay(const Quaternion& quat)
     250void SpaceShip::setStartDirection(const Quaternion& quat)
    251251{
    252252  this->mouseDir = quat;
     
    267267void SpaceShip::enter()
    268268{
    269   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     269  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
    270270  this->attachCamera();
    271271}
     
    273273void SpaceShip::leave()
    274274{
    275   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     275  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    276276  this->detachCamera();
    277277}
     
    320320{
    321321  WorldEntity::draw();
    322   this->getWeaponManager()->draw();
    323322
    324323  //this->debug(0);
  • trunk/src/world_entities/space_ships/space_ship.h

    r7221 r7337  
    2727    virtual void loadParams(const TiXmlElement* root);
    2828
    29     virtual void setAbsDirPlay(const Quaternion& rot);
     29    virtual void setStartDirection(const Quaternion& rot);
    3030
    3131    virtual void enter();
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7326 r7337  
    8888  //this->addWeapon(cannon, 0, 2);
    8989
    90   this->getWeaponManager()->changeWeaponConfig(1);
    91   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     90  this->getWeaponManager().changeWeaponConfig(1);
     91  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9292
    9393  this->loadModel("models/ships/hoverglider_mainbody.obj");
     
    186186  registerEvent(EV_MOUSE_MOTION);
    187187
    188   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     188  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    189189
    190190  // WEAPON_MANAGER configuration
    191   this->getWeaponManager()->setSlotCount(5);
    192 
    193   this->getWeaponManager()->setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);
    194   this->getWeaponManager()->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    195 
    196   this->getWeaponManager()->setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);
    197   this->getWeaponManager()->setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    198 
    199   this->getWeaponManager()->setSlotPosition(2, Vector(-1.63, .809, -.003));
    200   this->getWeaponManager()->setSlotCapability(2, WTYPE_HEAVY);
     191  this->getWeaponManager().setSlotCount(5);
     192
     193  this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750), &this->wingNodeLeft);
     194  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     195
     196  this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750), &this->wingNodeRight);
     197  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     198
     199  this->getWeaponManager().setSlotPosition(2, Vector(-1.63, .809, -.003));
     200  this->getWeaponManager().setSlotCapability(2, WTYPE_HEAVY);
    201201
    202202  /// TODO: THESE ARE TOO MUCH
    203   this->getWeaponManager()->setSlotPosition(3, Vector(-1.63, .678, -.652));
    204   this->getWeaponManager()->setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));
    205 
    206   this->getWeaponManager()->setSlotPosition(4, Vector(-1.63, .678, .652));
    207   this->getWeaponManager()->setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));
     203  this->getWeaponManager().setSlotPosition(3, Vector(-1.63, .678, -.652));
     204  this->getWeaponManager().setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));
     205
     206  this->getWeaponManager().setSlotPosition(4, Vector(-1.63, .678, .652));
     207  this->getWeaponManager().setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));
    208208
    209209  this->cameraNode.setRelCoor(1,5,0);
    210   this->getWeaponManager()->getFixedTarget()->setParent(&this->cameraNode);
    211   this->getWeaponManager()->getFixedTarget()->setRelCoor(1000,0,0);
     210  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
     211  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    212212}
    213213
     
    224224void TurbineHover::enter()
    225225{
    226   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     226  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
    227227
    228228  if (State::getCameraNode != NULL)
     
    236236void TurbineHover::leave()
    237237{
    238   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     238  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    239239  this->detachCamera();
    240240
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r7221 r7337  
    2323
    2424    virtual void loadParams(const TiXmlElement* root);
    25     virtual void setAbsDirPlay(const Quaternion& rot) {/* FIXME */};
     25    virtual void setStartDirection(const Quaternion& rot) {/* FIXME */};
    2626    virtual void enter();
    2727    virtual void leave();
Note: See TracChangeset for help on using the changeset viewer.