Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7337 in orxonox.OLD for trunk/src/world_entities/space_ships


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

orxonox/trunk: simple useless stuff

Location:
trunk/src/world_entities/space_ships
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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.