Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8880 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 6:02:33 PM (18 years ago)
Author:
patrick
Message:

door animation even nicer implemented

Location:
branches/single_player_map/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.h

    r8879 r8880  
    6969
    7070//! animation names enumeration
    71 typedef enum animType
     71typedef enum MD2animType
    7272  {
    7373    STAND,                       //0
  • branches/single_player_map/src/world_entities/door.cc

    r8879 r8880  
    2222
    2323#include "interactive_model.h"
    24 #include "md2/md2Model.h"
     24
    2525
    2626#include "door.h"
     
    3232
    3333CREATE_FACTORY(Door, CL_DOOR);
     34
     35
     36
     37//! list of all different animations a std md2model supports
     38sAnim Door::animationList[2] =
     39{
     40 // begin, end, fps, interruptable
     41  {   0,  15,  9,  0 },   //!< OPEN
     42  {   15, 30,  9,  0 }    //!< CLOSE
     43};
     44
    3445
    3546
     
    7889 * sets the animatin of this entity
    7990 */
    80 void  Door::setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback)
     91void  Door::setAnimation(int animNum, int playbackMode)
    8192{
    8293  if( likely(this->getModel(0) != NULL))
     
    108119    return;
    109120
    110   this->setAnimation(0, 1, 5, 0, MD2_ANIM_ONCE);
     121  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
    111122
    112123}
  • branches/single_player_map/src/world_entities/door.h

    r8879 r8880  
    44#include "world_entity.h"
    55
     6#include "md2/md2Model.h"
    67
    78class TiXmlElement;
     9
     10
     11//! animation names enumeration
     12typedef enum DoorAnimType
     13{
     14  OPEN = 0,
     15  CLOSE,
     16
     17  MAX_ANIMATIONS
     18};
    819
    920
     
    2031    void setActionRadius(float radius) { this->actionRadius = radius; }
    2132
    22     virtual void tick (float time);
    23 
    2433    void open();
    2534    void close();
     
    3039
    3140
     41    virtual void tick (float time);
     42
     43
    3244  private:
    3345    bool checkOpen();
    34     void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback);
     46    void setAnimation(int animNum, int playbackMode = 0);
    3547
    3648
     
    4052    float          actionRadius;      //!< action radius
    4153
     54    static sAnim   animationList[2];  //!< list of the animations
    4255
    4356};
Note: See TracChangeset for help on using the changeset viewer.