]> git.tdb.fi Git - libs/demoscene.git/blob - source/cameracontrol.h
Initial files lifted from the Skrolliparty 2 demo
[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 "sequencer.h"
7
8 class CameraControl: public Sequencer::Action
9 {
10 public:
11         class SetCamera: public Sequencer::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 start(float, float);
21         };
22
23         class AnimateCamera: public Sequencer::Action
24         {
25         private:
26                 CameraControl &control;
27                 const Msp::GL::Animation &anim;
28
29         public:
30                 AnimateCamera(CameraControl &, const Msp::GL::Animation &);
31
32                 virtual void start(float, float);
33         };
34
35 private:
36         Msp::GL::Camera camera;
37         Msp::GL::AnimationPlayer anim_player;
38
39 public:
40         void set_camera(const Msp::GL::Camera &);
41         void animate_camera(const Msp::GL::Animation &, float);
42         Msp::GL::Camera &get_camera() { return camera; }
43
44         virtual void tick(float, float);
45 };
46
47 #endif