Tatooine
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
tatooine::rendering::camera_interface< Real > Struct Template Reference

Interface for camera implementations. More...

#include <camera.h>

Inheritance diagram for tatooine::rendering::camera_interface< Real >:
[legend]
Collaboration diagram for tatooine::rendering::camera_interface< Real >:
[legend]

Public Types

using real_type = Real
 
using this_type = camera_interface< Real >
 
using vec2 = Vec2< Real >
 
using vec3 = Vec3< Real >
 
using vec4 = Vec4< Real >
 
using mat4 = Mat4< Real >
 
using ray_type = tatooine::ray< real_type, 3 >
 

Public Member Functions

constexpr camera_interface (vec3 const &eye, vec3 const &lookat, vec3 const &up, Vec4< std::size_t > const &viewport)
 
constexpr camera_interface (vec3 const &eye, vec3 const &lookat, vec3 const &up, Vec4< std::size_t > const &viewport, mat4 const &p)
 
virtual ~camera_interface ()=default
 
auto constexpr viewport () const -> auto const &
 Returns number of pixels of plane in x-direction. More...
 
auto constexpr viewport (std::size_t const i) const -> auto const &
 
auto constexpr plane_width () const
 Returns number of pixels of plane in x-direction. More...
 
auto constexpr plane_height () const
 Returns number of pixels of plane in y-direction. More...
 
auto constexpr aspect_ratio () const
 
auto constexpr eye () const -> auto
 
auto constexpr right_direction () const
 
auto constexpr up_direction () const
 
auto constexpr view_direction () const
 
auto constexpr set_viewport_without_update (std::size_t const bottom, std::size_t const left, std::size_t const width, std::size_t const height)
 
auto constexpr set_viewport (std::size_t const bottom, std::size_t const left, std::size_t const width, std::size_t const height)
 
auto constexpr set_resolution_without_update (std::size_t const width, std::size_t const height)
 
auto constexpr set_resolution (std::size_t const width, std::size_t const height)
 
auto set_gl_viewport () const
 
auto constexpr look_at (vec3 const &eye, vec3 const &lookat, vec3 const &up={0, 1, 0}) -> void
 
auto constexpr look_at (vec3 const &eye, arithmetic auto const pitch, arithmetic auto const yaw) -> void
 
auto constexpr transform_matrix () const -> auto const &
 
auto constexpr view_matrix () const
 
auto constexpr projection_matrix () const -> auto const &
 
auto view_projection_matrix () const
 
auto unproject (vec2 const &p) const
 Projects a screen coordinates to world coordinates. More...
 
auto unproject (vec3 const &p) const
 Projects a screen coordinates to world coordinates. More...
 
auto unproject (vec4 p) const
 Projects a homogeneous screen coordinates to world coordinates. More...
 
auto project (vec2 const &p) const
 Projects a world coordinate to screen coordinates. More...
 
auto project (vec3 const &p) const
 Projects a world coordinate to screen coordinates. More...
 
auto project (vec4 p) const
 Projects a homogeneous world coordinate to screen coordinates. More...
 
auto ray (Real const x, Real const y) const -> ray_type
 Gets a ray through plane at pixel with coordinate [x,y]. More...
 

Protected Member Functions

auto set_projection_matrix (mat4 const &projection_matrix) -> void
 

Private Attributes

Vec4< std::size_t > m_viewport
 
vec3 m_bottom_left
 
vec3 m_plane_base_x
 
vec3 m_plane_base_y
 
mat4 m_transform_matrix
 
mat4 m_projection_matrix
 

Detailed Description

template<floating_point Real>
struct tatooine::rendering::camera_interface< Real >

Interface for camera implementations.

Implementations must override the ray method that casts rays through the camera's image plane.

Member Typedef Documentation

◆ mat4

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::mat4 = Mat4<Real>

◆ ray_type

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::ray_type = tatooine::ray<real_type, 3>

◆ real_type

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::real_type = Real

◆ this_type

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::this_type = camera_interface<Real>

◆ vec2

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::vec2 = Vec2<Real>

◆ vec3

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::vec3 = Vec3<Real>

◆ vec4

template<floating_point Real>
using tatooine::rendering::camera_interface< Real >::vec4 = Vec4<Real>

Constructor & Destructor Documentation

◆ camera_interface() [1/2]

template<floating_point Real>
constexpr tatooine::rendering::camera_interface< Real >::camera_interface ( vec3 const &  eye,
vec3 const &  lookat,
vec3 const &  up,
Vec4< std::size_t > const &  viewport 
)
inlineconstexpr

◆ camera_interface() [2/2]

template<floating_point Real>
constexpr tatooine::rendering::camera_interface< Real >::camera_interface ( vec3 const &  eye,
vec3 const &  lookat,
vec3 const &  up,
Vec4< std::size_t > const &  viewport,
mat4 const &  p 
)
inlineconstexpr

◆ ~camera_interface()

template<floating_point Real>
virtual tatooine::rendering::camera_interface< Real >::~camera_interface ( )
virtualdefault

Member Function Documentation

◆ aspect_ratio()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::aspect_ratio ( ) const
inlineconstexpr

◆ eye()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::eye ( ) const -> auto
inlineconstexpr

◆ look_at() [1/2]

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::look_at ( vec3 const &  eye,
arithmetic auto const  pitch,
arithmetic auto const  yaw 
) -> void
inlineconstexpr

◆ look_at() [2/2]

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::look_at ( vec3 const &  eye,
vec3 const &  lookat,
vec3 const &  up = {0, 1, 0} 
) -> void
inlineconstexpr

◆ plane_height()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::plane_height ( ) const
inlineconstexpr

Returns number of pixels of plane in y-direction.

◆ plane_width()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::plane_width ( ) const
inlineconstexpr

Returns number of pixels of plane in x-direction.

◆ project() [1/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::project ( vec2 const &  p) const
inline

Projects a world coordinate to screen coordinates.

◆ project() [2/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::project ( vec3 const &  p) const
inline

Projects a world coordinate to screen coordinates.

◆ project() [3/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::project ( vec4  p) const
inline

Projects a homogeneous world coordinate to screen coordinates.

◆ projection_matrix()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::projection_matrix ( ) const -> auto const&
inlineconstexpr

◆ ray()

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::ray ( Real const  x,
Real const  y 
) const -> ray_type
inline

Gets a ray through plane at pixel with coordinate [x,y].

[0,0] is bottom left. ray goes through center of pixel.

◆ right_direction()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::right_direction ( ) const
inlineconstexpr

◆ set_gl_viewport()

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::set_gl_viewport ( ) const
inline

◆ set_projection_matrix()

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::set_projection_matrix ( mat4 const &  projection_matrix) -> void
inlineprotected

◆ set_resolution()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::set_resolution ( std::size_t const  width,
std::size_t const  height 
)
inlineconstexpr

◆ set_resolution_without_update()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::set_resolution_without_update ( std::size_t const  width,
std::size_t const  height 
)
inlineconstexpr

◆ set_viewport()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::set_viewport ( std::size_t const  bottom,
std::size_t const  left,
std::size_t const  width,
std::size_t const  height 
)
inlineconstexpr

◆ set_viewport_without_update()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::set_viewport_without_update ( std::size_t const  bottom,
std::size_t const  left,
std::size_t const  width,
std::size_t const  height 
)
inlineconstexpr

◆ transform_matrix()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::transform_matrix ( ) const -> auto const&
inlineconstexpr

◆ unproject() [1/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::unproject ( vec2 const &  p) const
inline

Projects a screen coordinates to world coordinates.

◆ unproject() [2/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::unproject ( vec3 const &  p) const
inline

Projects a screen coordinates to world coordinates.

◆ unproject() [3/3]

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::unproject ( vec4  p) const
inline

Projects a homogeneous screen coordinates to world coordinates.

◆ up_direction()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::up_direction ( ) const
inlineconstexpr

◆ view_direction()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::view_direction ( ) const
inlineconstexpr

◆ view_matrix()

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::view_matrix ( ) const
inlineconstexpr

◆ view_projection_matrix()

template<floating_point Real>
auto tatooine::rendering::camera_interface< Real >::view_projection_matrix ( ) const
inline

◆ viewport() [1/2]

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::viewport ( ) const -> auto const&
inlineconstexpr

Returns number of pixels of plane in x-direction.

◆ viewport() [2/2]

template<floating_point Real>
auto constexpr tatooine::rendering::camera_interface< Real >::viewport ( std::size_t const  i) const -> auto const&
inlineconstexpr

Member Data Documentation

◆ m_bottom_left

template<floating_point Real>
vec3 tatooine::rendering::camera_interface< Real >::m_bottom_left
private

◆ m_plane_base_x

template<floating_point Real>
vec3 tatooine::rendering::camera_interface< Real >::m_plane_base_x
private

◆ m_plane_base_y

template<floating_point Real>
vec3 tatooine::rendering::camera_interface< Real >::m_plane_base_y
private

◆ m_projection_matrix

template<floating_point Real>
mat4 tatooine::rendering::camera_interface< Real >::m_projection_matrix
private

◆ m_transform_matrix

template<floating_point Real>
mat4 tatooine::rendering::camera_interface< Real >::m_transform_matrix
private

◆ m_viewport

template<floating_point Real>
Vec4<std::size_t> tatooine::rendering::camera_interface< Real >::m_viewport
private

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