#ifndef CAMERA_H_ #define CAMERA_H_ #define GLM_ENABLE_EXPERIMENTAL #include #include #include #include #include "transform.h" struct Camera { Transform transform; float focalLength; // In mm float sensorHeight; float nearPlane; float farPlane; }; namespace CameraControls { void TranslateCamera(Camera& camera, const glm::vec3& translationDelta); void RotateCamera(Camera& camera, const glm::vec3& rotationDelta); void SetPosition(Camera& camera, const glm::vec3& position); void SetRotation(Camera& camera, const glm::vec3& rotation); glm::vec3 GetPosition(Camera& camera); glm::vec3 GetCenter(Camera& camera); float GetFOV(Camera& camera); void AdjustFocalLength(Camera& camera, float focalLength); void AdjustSensorHeight(Camera& camera, float sensorHeight); void AdjustNearPlane(Camera& camera, float nearPlane); void AdjustFarPlane(Camera& camera, float farPlane); glm::mat4 GetViewMatrix(Camera& camera); } #endif // CAMERA_H_