1 #ifndef CAMERACONTROLLER_H_
2 #define CAMERACONTROLLER_H_
4 #include <msp/graphics/window.h>
5 #include <msp/gl/camera.h>
6 #include <msp/input/keyboard.h>
7 #include <msp/input/mouse.h>
11 Moves the camera based on keyboard and mouse events. Controls are as follows:
15 Insert - view from top down
16 Wheel - adjust viewing distance
21 Ctrl + RMB - adjust viewing distance
22 Ctrl + MMB - adjust viewing distance
24 class CameraController
36 Msp::Input::Keyboard &keyboard;
37 Msp::Input::Mouse &mouse;
38 Msp::GL::Camera &camera;
48 CameraController(R2C2::View3D &, Msp::Input::Keyboard &, Msp::Input::Mouse &);
51 void set_look_direction(const Msp::GL::Vector3 &);
54 void move(float, float);
55 void adjust_distance(float);
61 void button_press(unsigned);
62 void button_release(unsigned);
63 void axis_motion(unsigned, float, float);
64 void key_press(unsigned);
65 void key_release(unsigned);
68 /** Return the focus point, i.e. where the look ray intersects with ground. */
69 Msp::GL::Vector3 get_focus() const;
71 /** Return distance from the focus point. */
72 float get_distance() const;
74 /** Return the viewport height at focus distance. */
75 float get_view_scale() const;