Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. //
  2. // Camera.hpp
  3. //
  4. // Created by CGIS on 28/10/2016.
  5. // Copyright © 2016 CGIS. All rights reserved.
  6. //
  7.  
  8. #ifndef Camera_hpp
  9. #define Camera_hpp
  10.  
  11. #include <iostream>
  12. #include "glm/glm.hpp"
  13. #include "glm/gtx/transform.hpp"
  14.  
  15. namespace gps {
  16.  
  17. enum MOVE_DIRECTION {MOVE_FORWARD, MOVE_BACKWARD, MOVE_RIGHT, MOVE_LEFT};
  18.  
  19. class Camera
  20. {
  21. public:
  22. //Camera constructor
  23. Camera(glm::vec3 cameraPosition, glm::vec3 cameraTarget);
  24. //return the view matrix, using glm::lookAt
  25. glm::mat4 getViewMatrix();
  26. //update the camera parameters
  27. void move(MOVE_DIRECTION direction, float speed);
  28. //yaw - rotate around y axis
  29. //pitch - rotate around x axis
  30. void rotate(float pitch, float yaw);
  31.  
  32. void keyboardCallback(GLFWwindow* window, int key, int scancode, int action, int mode);
  33. void mouseCallback(GLFWwindow* window, double xpos, double ypos);
  34.  
  35.  
  36. private:
  37. glm::vec3 cameraPosition;
  38. glm::vec3 cameraTarget;
  39. glm::vec3 cameraDirection;
  40. glm::vec3 cameraRightDirection;
  41. };
  42.  
  43. }
  44.  
  45. #endif /* Camera_hpp */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement