Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6198 in orxonox.OLD for branches/christmas_branche


Ignore:
Timestamp:
Dec 20, 2005, 9:57:31 PM (19 years ago)
Author:
patrick
Message:

christmas: better control now

Location:
branches/christmas_branche/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.cc

    r6191 r6198  
    155155
    156156
    157 
    158 
    159157/**
    160158  \brief sets the time in seconds passed since the last tick
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.h

    r6191 r6198  
    218218
    219219  void setAnim(int type);
    220   /**
    221    *  scales the current model
    222    * @param scaleFactor: the factor [0..1] to use for scaling
    223   */
     220  /**  returns the current animation @returns animation type */
     221  inline int MD2Model::getAnim() { return this->animationState.type; }
     222  /**  scales the current model @param scaleFactor: the factor [0..1] to use for scaling */
    224223  void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;}
    225224
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.cc

    r6195 r6198  
    137137  this->registerEvent(SDLK_a);
    138138  this->registerEvent(SDLK_d);
     139  this->registerEvent(SDLK_SPACE);
    139140  this->registerEvent(SDLK_q);
    140141  this->registerEvent(SDLK_e);
     
    256257  Vector move = this->velocity * time;
    257258  this->shiftCoor (move);
     259
     260  if( this->bJump)
     261  {
     262    if( ((MD2Model*)this->getModel(0))->getAnim() != JUMP) ((MD2Model*)this->getModel(0))->setAnim(JUMP);
     263  }
     264  else if( fabs(move.len()) > 0.0f)
     265  {
     266    if( ((MD2Model*)this->getModel(0))->getAnim() != RUN) ((MD2Model*)this->getModel(0))->setAnim(RUN);
     267  }
     268  else
     269  {
     270    if( ((MD2Model*)this->getModel(0))->getAnim() != STAND) ((MD2Model*)this->getModel(0))->setAnim(STAND);
     271  }
    258272
    259273  //orient the MD2Creature in direction of the mouse
     
    349363  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    350364    this->getWeaponManager()->previousWeaponConfig();
    351 
    352365  else if( event.type == SDLK_w)
    353366    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
    354367  else if( event.type == SDLK_s)
    355368    this->bDown = event.bPressed; //this->shiftCoor(0,-.1,0);
     369  else if( event.type == SDLK_SPACE)
     370    this->bJump = event.bPressed;
    356371  else if( event.type == EV_MOUSE_MOTION)
    357372  {
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.h

    r6195 r6198  
    6060    bool                  bStrafeL;           //!< strafe to the left side
    6161    bool                  bStrafeR;           //!< strafe to the rith side
     62    bool                  bJump;              //!< jump
    6263
    6364    float                 xMouse;             //!< mouse moved in x-Direction
Note: See TracChangeset for help on using the changeset viewer.