Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/simple_animation.h @ 3610

Last change on this file since 3610 was 3573, checked in by patrick, 20 years ago

orxonox/trunk: implemented skeleton for animatino player. added classes weapon and projectile, the base classes for future guns and rocket lunchers or whatever you will be wanting to implement. PS: animation player rules…

File size: 1.6 KB
Line 
1/*!
2    \file simple_animation.h
3    \brief A class to interpolate the movement of an object following descrete points in room and time
4    \todo implement it
5
6    This class has been done to animate some movement, works best for short
7    distances.
8*/
9
10#ifndef _SIMPLE_ANIMATION_H
11#define _SIMPLE_ANIMATION_H
12
13#include "base_object.h"
14#include "p_node.h"
15#include "list.h"
16
17
18typedef enum movementMode{LINEAR=0, EXP, NEG_EXP, SIN, COS};
19
20
21//! KeyFrame Class
22/**
23   This represents one point with orientation of the animation
24*/
25class KeyFrame : public PNode {
26 public:
27  KeyFrame(Vector* point, Quaternion* orientation, float time);
28  KeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode); 
29  virtual ~KeyFrame();
30
31  void set(Vector* point, Quaternion* orientation, float time);
32  void set(Vector* point, Quaternion* orientation, float time, movementMode mode);
33 
34 private:
35  float time;
36  movementMode mode;
37};
38
39
40//! Animation Class
41/**
42   Helps you making some small animation
43*/
44class SimpleAnimation : public BaseObject {
45 
46 public:
47  SimpleAnimation(PNode* parent);
48  virtual ~SimpleAnimation();
49
50  void addKeyFrame(Vector* point, Quaternion* orientation, float time);
51  void addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode);
52  void addKeyFrame(KeyFrame* frame);
53  void reset();
54
55  void start();
56  void stop();
57  void restart();
58  void pause();
59  void resume();
60
61  void tick(float time);
62
63 private:
64  bool bPause;                     //<! is set, when there is a pause
65  tList<KeyFrame>* frames;        //<! where keyframes are stored in
66  float localTime;
67  PNode* parent;
68 
69
70};
71
72#endif /* _SIMPLE_ANIMATION_H */
Note: See TracBrowser for help on using the repository browser.