Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

initial upload form mouse aiming in VS

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

    r10698 r10714  
    274274  registerVar( new SynchronizeableBool( &bFire, &bFire, "bSecFire", PERMISSION_OWNER));
    275275  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
     276//   registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) );
    276277
    277278  //this->airFriction = 0.5f;
     
    554555void SpaceShip::process(const Event &event)
    555556{
    556   //Playable::process(event);
     557//   Playable::process(event);
    557558
    558559  if( event.type == KeyMapper::PEV_LEFT)
     
    572573  else if( event.type == KeyMapper::PEV_FIRE2)
    573574    this->bSecFire = event.bPressed;
    574   else if( event.type == KeyMapper::PEV_FIRE1)
     575  else if( event.type == KeyMapper::PEV_FIRE1){
     576    printf("fireing primary");
    575577    this->bFire = event.bPressed;
     578  }
    576579  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
    577580  {
     
    580583  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    581584    this->previousWeaponConfig();
    582 
    583   if (!(State::getCamera()->getEventHandling()))
     585  else if( event.type == EV_MOUSE_MOTION)
     586  {
     587//     printf("Spaceship Mouse Motion Event\n");
     588//     dynamic_cast<Crosshair*>(this->weaponMan.getFixedTarget())->process(event);
     589//     this->weaponMan.process(event);
     590    this->xMouse += event.xRel;
     591    this->yMouse += event.yRel;
     592//     printf("Mouse Coord: %f, %f\n", this->xMouse, this->yMouse);
     593    this->weaponMan.getFixedTarget()->setRelCoor(10000, 4*xMouse, 4*yMouse);
     594  }
     595  else if (!(State::getCamera()->getEventHandling()))
    584596  {
    585597    //PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
     
    622634  }
    623635
    624 
    625   /*
    626   else if( event.type == EV_MOUSE_MOTION)
    627   {
    628 
    629     this->xMouse += event.xRel;
    630     this->yMouse += event.yRel;
    631   }
    632   */
    633636}
    634637
     
    821824        State::getCamera()->setEventHandling(false);
    822825
    823         PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
     826        PRINTF(0)("SETCAMERA %x\n", State::getCamera());
    824827        State::getCamera()->setViewMode(Camera::ViewNormal);
    825828        State::getCameraTargetNode()->setParent(this);
  • branches/presentation/src/world_entities/space_ships/space_ship.h

    r10698 r10714  
    168168    bool                  bInit;              //!< set true, if MP have been loaded
    169169
    170     /*
     170
    171171    float                 xMouse;             //!< mouse moved in x-Direction
    172172    float                 yMouse;             //!< mouse moved in y-Direction
    173173    float                 mouseSensitivity;   //!< the mouse sensitivity
    174     int                   yInvert;
    175     int                   controlVelocityX;
    176     int                   controlVelocityY;
    177     */
     174//     int                   yInvert;
     175//     int                   controlVelocityX;
     176//     int                   controlVelocityY;
     177
    178178
    179179    Vector                velocity;           //!< the velocity of the player.
     
    199199    void                  setCameraFovy(float fovy);
    200200
    201     /*
     201
    202202    Quaternion            mouseDir;           //!< the direction where the player wants to fly
    203     Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
     203    /*Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
    204204    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
    205205    Quaternion            rotQuat;
Note: See TracChangeset for help on using the changeset viewer.