camera.h 820 B

12345678910111213141516171819202122232425262728293031323334353637
  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. //In the future user input should control this. For now just simple movement
  11. void update(unsigned int deltaT);
  12. Matrix4 viewMatrix;
  13. Matrix4 projectionMatrix;
  14. //Position and direction of camera, used to build view matrix
  15. Vector3f position{0,0,8};
  16. Vector3f target{0,0,0};
  17. Vector3f up{0,1,0};
  18. Vector3f front{0, 0, -1};
  19. Vector3f side;
  20. //Values related to orbiting mode
  21. float radius = 2;
  22. bool orbiting = false;
  23. //Momentary fixed camera speed (FPS dependent)
  24. float camSpeed = 0.1f;
  25. Frustrum cameraFrustrum{DisplayManager::SCREEN_ASPECT_RATIO};
  26. };
  27. #endif