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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: camera.h
  5. *
  6. * Description: FPS style camera
  7. *
  8. * Version: 1.0
  9. * Created: 03/24/2014 04:58:12 PM
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: YOUR NAME (),
  14. * Organization:
  15. *
  16. * =====================================================================================
  17. */
  18. #pragma once
  19. #define GLM_FORCE_RADIANS
  20. #include <glm/glm.hpp>
  21. namespace vtk {
  22. class Window;
  23. class Camera {
  24. public:
  25. Camera();
  26. glm::mat4 getViewMatrix();
  27. glm::mat4 getAngleMatrix();
  28. glm::mat4 getProjectionMatrix();
  29. void update(const float& dTime);
  30. void setPosition(const glm::vec3& position);
  31. glm::vec3 getPosition();
  32. void setAspectRatio(const float& aspect);
  33. //id setAngleVector(const glm::vec3& angleVector);
  34. glm::vec3 getAngleVector();
  35. void move(const glm::vec3& offset);
  36. void moveRelative(const glm::vec3& offset);
  37. void rotate(const float& x, const float& y);
  38. private:
  39. glm::vec3 up;
  40. glm::vec3 position;
  41. glm::vec3 positionDelta;
  42. glm::vec3 direction;
  43. float pitch;
  44. float yaw;
  45. float pitchDelta;
  46. float yawDelta;
  47. float moveDampening;
  48. float tiltDampening;
  49. glm::mat4 mAngleMatrix;
  50. float mAspectRatio;
  51. float mFOV;
  52. };
  53. }