Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8878 in orxonox.OLD for branches/single_player_map/src


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

altering md2 model for dynamic animations choosement

Location:
branches/single_player_map/src
Files:
4 edited

Legend:

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

    r8724 r8878  
    3737
    3838    virtual void setAnimation(int animNum, int playbackMode = 0) = 0;
     39    virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable) {}
    3940    virtual int getAnimation() = 0;
     41
     42    virtual void setAnimationSpeed(float speed) {}
    4043};
    4144
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.cc

    r8490 r8878  
    103103  this->pModelInfo.pTexCoor = (float*)this->data->pTexCoor;
    104104
     105  this->animationSpeed = 1.0f;
     106
    105107  // triangle conversion
    106108  this->pModelInfo.pTriangles = new sTriangleExt[this->data->numTriangles];
     
    196198void MD2Model::tick(float time)
    197199{
    198   this->animate(time);
     200  this->animate(time * this->animationSpeed);
    199201  this->processLighting();
    200202  this->interpolate(/*this->verticesList*/);
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.h

    r8724 r8878  
    156156  void renderFrameTriangles() const;
    157157
    158 
    159158  virtual void setAnimation(int type, int animPlayback = MD2_ANIM_LOOP);
     159  virtual void setAnimation(int firstFrame, int lastFrame, int fps, int bStoppable);
    160160  /**  returns the current animation @returns animation type */
    161161  inline int MD2Model::getAnimation() { return this->animationState.type; }
     162  virtual void setAnimationSpeed(float speed) { this->animationSpeed = speed; }
    162163  /**  scales the current model @param scaleFactor: the factor [0..1] to use for scaling */
    163164  void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;}
     
    186187 private:
    187188  float               scaleFactor;                      //!< the scale factor (individual)
     189  float               animationSpeed;                   //!< the speed of the animation (factor for the time)
    188190  sAnimState          animationState;                   //!< animation state of the model
    189191  sVec3D              verticesList[MD2_MAX_VERTICES];   //!< place to temp sav the vert
  • branches/single_player_map/src/world_entities/door.cc

    r8876 r8878  
    7474
    7575
     76/**
     77 * sets the animatin of this entity
     78 */
    7679void  Door::setAnimation(int animationIndex, int animPlaybackMode)
    7780{
     
    8184
    8285
     86/**
     87 * ticks the door
     88 * @param time: time since last tick
     89 */
    8390void Door::tick (float time)
    8491{
     
    8693    ((InteractiveModel*)this->getModel(0))->tick(time);
    8794
    88 
     95  this->checkOpen();
    8996}
    9097
Note: See TracChangeset for help on using the changeset viewer.