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 989B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 setPosition(glm::vec3 p) { pos = p; }
  20. static glm::vec3 getPosition() { return pos; }
  21. static void setSensitivityX(float sens) { rotationDeltaX = sens; }
  22. static float getSensitivityX() { return rotationDeltaX; }
  23. static void setSensitivityY(float sens) { rotationDeltaY = sens; }
  24. static float getSensitivityY() { return rotationDeltaY; }
  25. private:
  26. static glm::vec3 pos;
  27. static float thetaX, thetaY;
  28. static float rotationDeltaX, rotationDeltaY;
  29. };
  30. #endif