Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. void Camera::SetCamera(
  2. float verticalFov,
  3. float aspectRatio,
  4. float nearPlane,
  5. float farPlane,
  6. float x,
  7. float y,
  8. float z){
  9.  
  10. m_camera.setToIdentity();
  11.  
  12. m_camera.perspective(
  13. verticalFov,
  14. aspectRatio,
  15. nearPlane,
  16. farPlane);
  17.  
  18. m_verticalFov = verticalFov;
  19. m_aspectRatio = aspectRatio;
  20. m_nearPlane = nearPlane;
  21. m_farPlane = farPlane;
  22.  
  23. m_camera.translate(
  24. x,
  25. y,
  26. z);
  27. m_x = x;
  28. m_y = y;
  29. m_z = z;
  30. }
  31.  
  32. const QMatrix4x4& Camera::GetCamera(){
  33. return m_camera;
  34. }
  35.  
  36. void Camera::SetCameraPosition(float x, float y, float z){
  37.  
  38. m_camera.setToIdentity();
  39.  
  40. m_camera.perspective(
  41. m_verticalFov,
  42. m_aspectRatio,
  43. m_nearPlane,
  44. m_farPlane);
  45. m_camera.translate(x,y,z);
  46.  
  47. m_x = x;
  48. m_y = y;
  49. m_z = z;
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement