Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 18, 2007, 3:52:34 PM (18 years ago)
Author:
nicolasc
Message:

crosshair moves, but WM not

Location:
branches/presentation/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r10714 r10715  
    204204  this->secWeaponMan.addWeaponToSlot(0, 2, "SwarmLauncher");
    205205
     206  this->mouseSensitivity = 4;
    206207
    207208  this->weaponMan.changeWeaponConfig(0);
     
    343344  LoadParam(root, "loadWeapon", this, SpaceShip, loadWeapon)
    344345  .describe("set weapon regeneration");
     346
     347  LoadParam(root, "mouseSenitivity", this, SpaceShip, setMouseSensitivity);
    345348
    346349/*
     
    573576  else if( event.type == KeyMapper::PEV_FIRE2)
    574577    this->bSecFire = event.bPressed;
    575   else if( event.type == KeyMapper::PEV_FIRE1){
    576     printf("fireing primary");
     578  else if( event.type == KeyMapper::PEV_FIRE1)
    577579    this->bFire = event.bPressed;
    578   }
    579580  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
    580581  {
     
    591592    this->yMouse += event.yRel;
    592593//     printf("Mouse Coord: %f, %f\n", this->xMouse, this->yMouse);
    593     this->weaponMan.getFixedTarget()->setRelCoor(10000, 4*xMouse, 4*yMouse);
     594    this->weaponMan.getFixedTarget()->setRelCoor(10000, -10 * this->mouseSensitivity * yMouse, 10 * this->mouseSensitivity * xMouse);
     595    this->secWeaponMan.getFixedTarget()->setRelCoor(10000, -10 * this->mouseSensitivity * yMouse, 10 * this->mouseSensitivity * xMouse);
    594596  }
    595597  else if (!(State::getCamera()->getEventHandling()))
  • branches/presentation/src/world_entities/space_ships/space_ship.h

    r10714 r10715  
    9797    virtual void hit(float damage, WorldEntity* killer);
    9898
    99     void                  setCameraDistance(float dist);
     99    void setCameraDistance(float dist);
     100
     101    void setMouseSensitivity(float sens) { this->mouseSensitivity = sens;};
    100102
    101103  private:
     
    105107
    106108//    void regen(float time);  //!< handler for shield and electronic regeneration
    107 
     109// moove to WE
    108110    void weaponRegen(float time);   //!< weapon energy regeneration
    109111
     
    112114//     void updateElectronicWidget();
    113115//     void updateShieldWidget();
    114 
     116// moved to WE
    115117    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
    116118    WeaponManager         secWeaponMan;       //!< the secondary weapon manager: managing a list of special weapons to weapon-slot mapping
     
    118120    Playable::Playmode    playmode;           //!< The current playmode.
    119121
    120     //ship atributes
     122    //ship atributes, all moved to WE
    121123//    float       shieldCur;          //!< current shield
    122124//    float       shieldMax;          //!< maximum shield
Note: See TracChangeset for help on using the changeset viewer.