camera.h 895 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef CAMERA_H
  2. #define CAMERA_H
  3. #include "matrix.h"
  4. #include "vector3D.h"
  5. #include "geometry.h"
  6. #include "displayManager.h"
  7. struct Camera{
  8. Camera();
  9. bool checkVisibility(AABox *bounds);
  10. //Updates the camera matrices with the user input obtained in the input class
  11. void update(unsigned int deltaT);
  12. void resetCamera();
  13. Matrix4 viewMatrix;
  14. Matrix4 projectionMatrix;
  15. //Position and direction of camera, used to build view matrix
  16. Vector3f position{0,0,8};
  17. Vector3f target{0,0,0};
  18. Vector3f up{0,1,0};
  19. Vector3f front{0, 0, -1};
  20. Vector3f side;
  21. //Values related to orbiting mode
  22. float radius = 2;
  23. bool orbiting = true;
  24. //Momentary fixed camera speed (FPS dependent)
  25. float camSpeed = 0.1f;
  26. float pitch = 0;
  27. float yaw = -90;
  28. Frustrum cameraFrustrum{DisplayManager::SCREEN_ASPECT_RATIO};
  29. };
  30. #endif