Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8879 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 5:55:06 PM (18 years ago)
Author:
patrick
Message:

door animation functions

Location:
branches/single_player_map/src
Files:
5 edited

Legend:

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

    r8878 r8879  
    3737
    3838    virtual void setAnimation(int animNum, int playbackMode = 0) = 0;
    39     virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable) {}
     39    virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback) {}
    4040    virtual int getAnimation() = 0;
    4141
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.cc

    r8878 r8879  
    161161
    162162/**
     163 * sets the animation type
     164 * @param firstFrame: index of the first frame
     165 * @param lastFrame: index of the last frame
     166 * @param fps: frames per second
     167 * @param bStoppable: is 1 if so, 0 else
     168 */
     169void MD2Model::setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback)
     170{
     171  this->animationState.startFrame = firstFrame;
     172  this->animationState.endFrame = lastFrame;
     173  this->animationState.nextFrame = firstFrame + 1;
     174  this->animationState.fps = fps;
     175  this->animationState.type = 0;
     176  this->animationState.numPlays = 0;
     177  this->animationState.animPlaybackMode = animPlayback;
     178
     179  this->animationState.interpolationState = 0.0f;
     180  this->animationState.localTime = 0.0f;
     181  this->animationState.lastTime = 0.0f;
     182  this->animationState.currentFrame = firstFrame;
     183}
     184
     185/**
    163186  \brief sets the animation type
    164187* @param type: animation type
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.h

    r8878 r8879  
    157157
    158158  virtual void setAnimation(int type, int animPlayback = MD2_ANIM_LOOP);
    159   virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable);
     159  virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback);
    160160  /**  returns the current animation @returns animation type */
    161161  inline int MD2Model::getAnimation() { return this->animationState.type; }
  • branches/single_player_map/src/world_entities/door.cc

    r8878 r8879  
    2121#include "util/loading/load_param.h"
    2222
    23 
    2423#include "interactive_model.h"
     24#include "md2/md2Model.h"
    2525
    2626#include "door.h"
     
    5757  this->setClassID(CL_DOOR, "Door");
    5858  this->toList(OM_COMMON);
     59
     60  this->bLocked = false;
    5961}
    6062
     
    7072      .describe("sets the action radius of the door")
    7173      .defaultValues(1);
    72 
    7374}
    7475
     
    7778 * sets the animatin of this entity
    7879 */
    79 void  Door::setAnimation(int animationIndex, int animPlaybackMode)
     80void  Door::setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback)
    8081{
    8182  if( likely(this->getModel(0) != NULL))
    82     ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode);
     83    ((InteractiveModel*)this->getModel(0))->setAnimation(firstFrame, lastFrame, fps, bStoppable, animPlayback);
     84
     85
    8386}
    8487
     
    105108    return;
    106109
    107 //   this->setAnimation();
     110  this->setAnimation(0, 1, 5, 0, MD2_ANIM_ONCE);
    108111
    109112}
  • branches/single_player_map/src/world_entities/door.h

    r8876 r8879  
    3232  private:
    3333    bool checkOpen();
    34     void setAnimation(int animationIndex, int animPlaybackMode);
     34    void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable, int animPlayback);
    3535
    3636
Note: See TracChangeset for help on using the changeset viewer.