Changeset 3848 in orxonox.OLD for orxonox/trunk/src/simple_animation.h
- Timestamp:
- Apr 17, 2005, 2:16:45 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.h
r3847 r3848 13 13 #include "base_object.h" 14 14 #include "list.h" 15 #include "animation _player.h"15 #include "animation.h" 16 16 17 17 … … 30 30 This represents one point with direction of the animation 31 31 */ 32 typedef struct KeyFrame {32 typedef struct KeyFrame3D { 33 33 Vector* position; 34 34 Quaternion* direction; … … 42 42 This represents an animation for a object 43 43 */ 44 class Animation3D 44 class Animation3D : public Animation 45 45 { 46 46 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 47 74 WorldEntity* object; 48 75 Vector* lastPosition; … … 51 78 float localTime; 52 79 53 tList<KeyFrame >* frames;54 KeyFrame * currentFrame;55 KeyFrame * lastFrame;80 tList<KeyFrame3D>* frames; 81 KeyFrame3D* currentFrame; 82 KeyFrame3D* lastFrame; 56 83 57 84 bool bRunning; … … 75 102 void addKeyFrame(Vector* point, Quaternion* direction, float time); 76 103 void addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode); 77 void addKeyFrame(KeyFrame * frame);104 void addKeyFrame(KeyFrame3D* frame); 78 105 void setAnimationMode(animationMode mode); 79 106 void reset(); … … 94 121 bool bDescriptive; //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands 95 122 bool bRunning; //<! is set, when the animation is running 96 tList<KeyFrame >* frames; //<! where keyframes are stored in123 tList<KeyFrame3D>* frames; //<! where keyframes are stored in 97 124 tList<Animation3D>* animators; //<! a list of animation's 98 KeyFrame * currentFrame; //<! the frame that is been played now99 KeyFrame * lastFrame;125 KeyFrame3D* currentFrame; //<! the frame that is been played now 126 KeyFrame3D* lastFrame; 100 127 Vector* lastPosition; 101 128 movementMode mode; //<! this is an enum of the mode, how the speed is distributed
Note: See TracChangeset
for help on using the changeset viewer.