31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
#pragma once
|
|
|
|
// libs
|
|
#define GLM_FORCE_RADIANS
|
|
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
|
#include <glm/glm.hpp>
|
|
|
|
namespace hk
|
|
{
|
|
class Camera
|
|
{
|
|
public:
|
|
Camera() = default;
|
|
~Camera() = default;
|
|
|
|
void setOrthographicProjection(float left, float right, float top, float bottom, float near, float far);
|
|
void setPerspectiveProjection(float fovY, float aspect, float near, float far);
|
|
|
|
void setViewDirection(glm::vec3 position, glm::vec3 direction, glm::vec3 up = glm::vec3{0.f, -1.f, 0.f});
|
|
void setViewTarget(glm::vec3 position, glm::vec3 target, glm::vec3 up = glm::vec3{0.f, -1.f, 0.f});
|
|
void setViewYXZ(glm::vec3 position, glm::vec3 rotation);
|
|
|
|
const glm::mat4& getProjection() const { return m_projectionMatrix; }
|
|
const glm::mat4& getView() const { return m_viewMatrix; }
|
|
const glm::mat4& getInverseView() const { return m_inverseViewMatrix; }
|
|
private:
|
|
glm::mat4 m_projectionMatrix{1.0f};
|
|
glm::mat4 m_viewMatrix{1.0f};
|
|
glm::mat4 m_inverseViewMatrix{1.0f};
|
|
};
|
|
} // namespace hk
|