MOS
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mos::gfx::Camera Class Referencefinal

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 &center=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 &center, 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
 

Detailed Description

Rendering camera view.

Member Function Documentation

◆ aspect_ratio()

auto mos::gfx::Camera::aspect_ratio ( ) const -> float

Get the aspect ratio.

◆ center()

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.

◆ direction() [1/2]

auto mos::gfx::Camera::direction ( ) const -> glm::vec3

Forward direction.

◆ direction() [2/2]

auto mos::gfx::Camera::direction ( const glm::vec3 &  direction,
const glm::vec3 &  up = glm::vec3(0.0f, 0.0f, 1.0f) 
) -> void

Set direction.

◆ far_plane()

auto mos::gfx::Camera::far_plane ( ) const -> float

Get far clip plane.

◆ field_of_view_horizontal()

auto mos::gfx::Camera::field_of_view_horizontal ( ) const -> float

Get the horizonal field of view.

◆ field_of_view_vertical()

auto mos::gfx::Camera::field_of_view_vertical ( ) const -> float

Get the vertical field of view.

◆ in_frustum()

auto mos::gfx::Camera::in_frustum ( const glm::vec3 &  point,
float  radius 
) const -> bool

Check if sphere with a radius is within camera frustum.

◆ near_plane()

auto mos::gfx::Camera::near_plane ( ) const -> float

Get near clip plane.

◆ position()

auto mos::gfx::Camera::position ( const glm::vec3 &  position,
const glm::vec3 &  up = glm::vec3(0.0f, 0.0f, 1.0f) 
) -> void

Set position.

◆ projection() [1/2]

auto mos::gfx::Camera::projection ( ) const -> glm::mat4

Get projection matrix.

◆ projection() [2/2]

auto mos::gfx::Camera::projection ( const glm::mat4 &  proj) -> void

Set projection matrix.


The documentation for this class was generated from the following file: