PSMoveService
Camera.h
1 #ifndef CAMERA_H
2 #define CAMERA_H
3 
4 //-- includes -----
5 #include <glm/glm.hpp>
6 
7 //-- constants -----
8 enum eCameraType
9 {
10  _cameraNone,
11  _cameraOrbit,
12  _cameraFixed
13 };
14 
15 //-- definitions -----
16 class Camera
17 {
18 public:
19  Camera(class Renderer *renderer)
20  : m_renderer(renderer)
21  , m_cameraOrbitYawDegrees(0.f)
22  , m_cameraOrbitPitchDegrees(0.f)
23  , m_cameraOrbitRadius(100.f)
24  , m_cameraPosition(0.f, 0.f, 100.f)
25  , m_isPanningOrbitCamera(false)
26  , m_isLocked(false)
27  { }
28 
29  void onMouseMotion(int deltaX, int deltaY);
30  void onMouseButtonDown(int buttonIndex);
31  void onMouseButtonUp(int buttonIndex);
32  void onMouseWheel(int scrollAmount);
33 
34  void setIsLocked(bool locked);
35  void setCameraOrbitLocation(float yawDegrees, float pitchDegrees, float radius);
36  void setCameraOrbitRadius(float radius);
37  void resetOrientation();
38  void reset();
39  void publishCameraViewMatrix();
40 
41 private:
42  class Renderer *m_renderer;
43  float m_cameraOrbitYawDegrees;
44  float m_cameraOrbitPitchDegrees;
45  float m_cameraOrbitRadius;
46  glm::vec3 m_cameraPosition;
47  bool m_isPanningOrbitCamera;
48  bool m_isLocked;
49 };
50 
51 #endif //CAMERA_H
Definition: Renderer.h:18
OpenGL Mathematics (glm.g-truc.net)
Definition: type_mat2x2.hpp:39
Definition: Camera.h:16