Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Camera.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * \file include/Camera.h
  3. * \brief Camera class
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _CAMERA_H_
  8. #define _CAMERA_H_
  9. #include <glm/vec3.hpp>
  10. #include <glm/mat4x4.hpp>
  11. class Camera {
  12. public:
  13. static void reset();
  14. static void handleAction(ActionEvents action, bool isFinished);
  15. static void handleMouseMotion(int x, int y);
  16. static glm::mat4 getViewMatrix();
  17. static float getRadianPitch() { return thetaX; }
  18. static float getRadianYaw() { return thetaY; }
  19. static void setRadianPitch(float x) { thetaX = x; }
  20. static void setPosition(glm::vec3 p) { pos = p; }
  21. static glm::vec3 getPosition() { return pos; }
  22. static void setSensitivityX(float sens) { rotationDeltaX = sens; }
  23. static float getSensitivityX() { return rotationDeltaX; }
  24. static void setSensitivityY(float sens) { rotationDeltaY = sens; }
  25. static float getSensitivityY() { return rotationDeltaY; }
  26. private:
  27. static glm::vec3 pos;
  28. static float thetaX, thetaY;
  29. static float rotationDeltaX, rotationDeltaY;
  30. };
  31. #endif