]> git.tdb.fi Git - libs/demoscene.git/blob - source/cameracontrol.h
Framework for loading sequences from files
[libs/demoscene.git] / source / cameracontrol.h
1 #ifndef MSP_DEMOSCENE_CAMERACONTROL_H_
2 #define MSP_DEMOSCENE_CAMERACONTROL_H_
3
4 #include <msp/gl/animationplayer.h>
5 #include <msp/gl/camera.h>
6 #include "action.h"
7
8 class CameraControl: public Action
9 {
10 public:
11         class SetCamera: public Action
12         {
13         private:
14                 CameraControl &control;
15                 const Msp::GL::Camera &camera;
16
17         public:
18                 SetCamera(CameraControl &, const Msp::GL::Camera &);
19
20                 virtual void validate() const { }
21
22                 virtual void start(float, float);
23         };
24
25         class AnimateCamera: public Action
26         {
27         private:
28                 CameraControl &control;
29                 const Msp::GL::Animation &anim;
30
31         public:
32                 AnimateCamera(CameraControl &, const Msp::GL::Animation &);
33
34                 virtual void validate() const { }
35
36                 virtual void start(float, float);
37         };
38
39 private:
40         Msp::GL::Camera camera;
41         Msp::GL::AnimationPlayer anim_player;
42
43 public:
44         void set_camera(const Msp::GL::Camera &);
45         void animate_camera(const Msp::GL::Animation &, float);
46         Msp::GL::Camera &get_camera() { return camera; }
47
48         virtual void validate() const { }
49
50         virtual void tick(float, float);
51 };
52
53 #endif