MOS
|
Rendering camera view. More...
#include <camera.hpp>
Public Types | |
using | Planes = std::array< glm::vec4, 6 > |
Public Member Functions | |
Camera (const glm::vec3 &position=glm::vec3(0.0f), const glm::vec3 ¢er=glm::vec3(0.0f), const glm::mat4 &projection=glm::mat4(1.0f), const glm::vec3 &up=glm::vec3(0.0f, 0.0f, 1.0f)) | |
auto | position () const -> glm::vec3 |
auto | position (const glm::vec3 &position, const glm::vec3 &up=glm::vec3(0.0f, 0.0f, 1.0f)) -> void |
Set position. More... | |
auto | center (const glm::vec3 ¢er, const glm::vec3 &up=glm::vec3(0.0f, 0.0f, 1.0f)) -> void |
Set center/focus point. More... | |
auto | direction () const -> glm::vec3 |
Forward direction. More... | |
auto | right () const -> glm::vec3 |
auto | direction (const glm::vec3 &direction, const glm::vec3 &up=glm::vec3(0.0f, 0.0f, 1.0f)) -> void |
Set direction. More... | |
auto | aspect_ratio () const -> float |
Get the aspect ratio. More... | |
auto | in_frustum (const glm::vec3 &point, float radius) const -> bool |
Check if sphere with a radius is within camera frustum. More... | |
auto | near_plane () const -> float |
Get near clip plane. More... | |
auto | far_plane () const -> float |
Get far clip plane. More... | |
auto | projection () const -> glm::mat4 |
Get projection matrix. More... | |
auto | projection (const glm::mat4 &proj) -> void |
Set projection matrix. More... | |
auto | view () const -> glm::mat4 |
Get view matrix. | |
auto | view (const glm::mat4 mat) -> void |
Set view matrix. | |
auto | field_of_view_vertical () const -> float |
Get the vertical field of view. More... | |
auto | field_of_view_horizontal () const -> float |
Get the horizonal field of view. More... | |
Static Public Member Functions | |
static auto | load (const std::string &directory, const std::string &path, const glm::mat4 &parent_transform=glm::mat4(1.0f)) -> Camera |
Rendering camera view.
auto mos::gfx::Camera::aspect_ratio | ( | ) | const -> float |
Get the aspect ratio.
auto mos::gfx::Camera::center | ( | const glm::vec3 & | center, |
const glm::vec3 & | up = glm::vec3(0.0f, 0.0f, 1.0f) |
||
) | -> void |
Set center/focus point.
auto mos::gfx::Camera::direction | ( | ) | const -> glm::vec3 |
Forward direction.
auto mos::gfx::Camera::direction | ( | const glm::vec3 & | direction, |
const glm::vec3 & | up = glm::vec3(0.0f, 0.0f, 1.0f) |
||
) | -> void |
Set direction.
auto mos::gfx::Camera::far_plane | ( | ) | const -> float |
Get far clip plane.
auto mos::gfx::Camera::field_of_view_horizontal | ( | ) | const -> float |
Get the horizonal field of view.
auto mos::gfx::Camera::field_of_view_vertical | ( | ) | const -> float |
Get the vertical field of view.
auto mos::gfx::Camera::in_frustum | ( | const glm::vec3 & | point, |
float | radius | ||
) | const -> bool |
Check if sphere with a radius is within camera frustum.
auto mos::gfx::Camera::near_plane | ( | ) | const -> float |
Get near clip plane.
auto mos::gfx::Camera::position | ( | const glm::vec3 & | position, |
const glm::vec3 & | up = glm::vec3(0.0f, 0.0f, 1.0f) |
||
) | -> void |
Set position.
auto mos::gfx::Camera::projection | ( | ) | const -> glm::mat4 |
Get projection matrix.
auto mos::gfx::Camera::projection | ( | const glm::mat4 & | proj | ) | -> void |
Set projection matrix.