Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/levelloader/src/simple_animation.h @ 3646

Last change on this file since 3646 was 3605, checked in by bensch, 20 years ago

orxonox/trunk: merged trunk back to levelloader
merged with command:
svn merge -r 3499:HEAD trunk branches/levelloader

Conflicts in
C track_manager.h
C world_entities/player.cc
C world_entities/player.h
C world_entities/environment.h
C lib/coord/p_node.cc
C defs/debug.h
C track_manager.cc
C story_entities/campaign.h

solved in merge-favouring. It was quite easy because Chris only worked on the headers, and he didi it quite clean. Thats the spirit :)

Conflits in world.cc are a MESS: fix it

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.