Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3848 in orxonox.OLD for orxonox/trunk/src/simple_animation.h


Ignore:
Timestamp:
Apr 17, 2005, 2:16:45 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: names of keyframes:
KeyFrame → KeyFrame3D
AnimKeyFrame → KeyFrameF (F for float)

also changed some stuff in the Animation3D-class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/simple_animation.h

    r3847 r3848  
    1313#include "base_object.h"
    1414#include "list.h"
    15 #include "animation_player.h"
     15#include "animation.h"
    1616
    1717
     
    3030   This represents one point with direction of the animation
    3131*/
    32 typedef struct KeyFrame {
     32typedef struct KeyFrame3D {
    3333  Vector* position;
    3434  Quaternion* direction;
     
    4242   This represents an animation for a object
    4343*/
    44 class Animation3D
     44class Animation3D : public Animation
    4545{
    4646 public:
     47  Animation3D(void);
     48  virtual ~Animation3D(void);
     49   
     50  virtual void rewind(void);
     51
     52  void addKeyFrame(Vector* point, Quaternion* direction, float time, ANIM_FUNCTION animFunc = ANIM_LINEAR);
     53  void addKeyFrame(KeyFrame3D* frame);
     54
     55  virtual void tick(float timePassed);
     56
     57  // animation functions
     58  void setAnimFunc(ANIM_FUNCTION animFunc);
     59
     60  float constant(float timePassed) const;
     61  float linear(float timePassed) const;
     62  float sine(float timePassed) const;
     63  float cosine(float timePassed) const;
     64  float exp(float timePassed) const;
     65  float negExp(float timePassed) const;
     66  float quadratic(float timePassed) const;
     67  float random(float timePassed) const;
     68  //  ANIM_FUNCTION animFunc;
     69  KeyFrame3D* currentKeyFrame;
     70  KeyFrame3D* nextKeyFrame;
     71  tList<KeyFrame3D>* keyFrameList;
     72
     73  // private
    4774  WorldEntity* object;
    4875  Vector* lastPosition;
     
    5178  float localTime;
    5279
    53   tList<KeyFrame>* frames;
    54   KeyFrame* currentFrame;
    55   KeyFrame* lastFrame;
     80  tList<KeyFrame3D>* frames;
     81  KeyFrame3D* currentFrame;
     82  KeyFrame3D* lastFrame;
    5683
    5784  bool bRunning;
     
    75102  void addKeyFrame(Vector* point, Quaternion* direction, float time);
    76103  void addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode);
    77   void addKeyFrame(KeyFrame* frame);
     104  void addKeyFrame(KeyFrame3D* frame);
    78105  void setAnimationMode(animationMode mode);
    79106  void reset();
     
    94121  bool bDescriptive;               //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands
    95122  bool bRunning;                   //<! is set, when the animation is running
    96   tList<KeyFrame>* frames;         //<! where keyframes are stored in
     123  tList<KeyFrame3D>* frames;         //<! where keyframes are stored in
    97124  tList<Animation3D>* animators;      //<! a list of animation's
    98   KeyFrame* currentFrame;          //<! the frame that is been played now
    99   KeyFrame* lastFrame;
     125  KeyFrame3D* currentFrame;          //<! the frame that is been played now
     126  KeyFrame3D* lastFrame;
    100127  Vector* lastPosition;
    101128  movementMode mode;               //<! this is an enum of the mode, how the speed is distributed
Note: See TracChangeset for help on using the changeset viewer.