14 using Planes = std::array<glm::vec4, 6>;
15 Camera(
const glm::vec3 &position = glm::vec3(0.0f),
16 const glm::vec3 &
center = glm::vec3(0.0f),
18 const glm::vec3 &up = glm::vec3(0.0f, 0.0f, 1.0f));
20 static auto load(
const std::string &directory,
const std::string &path,
21 const glm::mat4 &parent_transform = glm::mat4(1.0f))
24 auto position()
const -> glm::vec3;
27 auto position(
const glm::vec3 &position,
28 const glm::vec3 &up = glm::vec3(0.0f, 0.0f, 1.0f)) -> void;
32 const glm::vec3 &up = glm::vec3(0.0f, 0.0f, 1.0f)) -> void;
37 auto right()
const -> glm::vec3;
41 const glm::vec3 &up = glm::vec3(0.0f, 0.0f, 1.0f)) -> void;
47 auto in_frustum(
const glm::vec3 &point,
float radius)
const -> bool;
59 auto projection(
const glm::mat4 &proj) -> void;
62 auto view()
const -> glm::mat4;
65 auto view(
const glm::mat4 mat) -> void;
74 auto calculate_view(
const glm::vec3 &position,
const glm::vec3 ¢er,
75 const glm::vec3 &up) -> void;
76 auto calculate_frustum() -> void;
77 auto calculate_near_far() -> void;
78 glm::mat4 projection_{};
80 Planes frustum_planes_;
auto near_plane() const -> float
Get near clip plane.
auto in_frustum(const glm::vec3 &point, float radius) const -> bool
Check if sphere with a radius is within camera frustum.
auto far_plane() const -> float
Get far clip plane.
auto projection() const -> glm::mat4
Get projection matrix.
Rendering camera view.
Definition: camera.hpp:12
auto field_of_view_vertical() const -> float
Get the vertical field of view.
auto field_of_view_horizontal() const -> float
Get the horizonal field of view.
auto direction() const -> glm::vec3
Forward direction.
auto aspect_ratio() const -> float
Get the aspect ratio.
auto view() const -> glm::mat4
Get view matrix.
auto center(const glm::vec3 ¢er, const glm::vec3 &up=glm::vec3(0.0f, 0.0f, 1.0f)) -> void
Set center/focus point.