1#ifndef TATOOINE_RENDERING_PERSPECTIVE_CAMERA_H
2#define TATOOINE_RENDERING_PERSPECTIVE_CAMERA_H
14template <
floating_po
int Real>
32 vec3 const& up, Real
const fov, Real
const near,
33 Real
const far, std::size_t
const res_x,
34 std::size_t
const res_y)
36 eye, lookat, up,
Vec4<std::size_t>{0, 0, res_x, res_y},
38 fov,
static_cast<Real
>(res_x) /
static_cast<Real
>(res_y), near,
46 Real
const near, Real
const far,
47 std::size_t
const res_x, std::size_t
const res_y)
54 std::size_t
const res_x, std::size_t
const res_y)
60 template <
typename EyeReal,
typename LookatReal,
typename UpReal,
65 std::size_t
const res_x, std::size_t
const res_y)
78 auto constexpr set_projection_matrix(Real const fov, Real const near,
79 Real const far) ->
void {
80 set_projection_matrix(
85template <
typename EyeReal,
typename LookatReal,
typename UpReal,
86 typename FovReal,
typename NearReal,
typename FarReal>
89 FarReal
const, std::size_t
const, std::size_t
const)
93template <
typename EyeReal,
typename LookatReal,
typename FovReal,
94 typename NearReal,
typename FarReal>
96 FovReal
const, NearReal
const, FarReal
const,
97 std::size_t
const, std::size_t
const)
101template <
typename EyeReal,
typename LookatReal,
typename FovReal>
103 FovReal
const, std::size_t
const, std::size_t
const)
106template <
typename EyeReal,
typename LookatReal,
typename UpReal,
auto constexpr perspective_matrix(Real const fov_angles, Real const aspect_ratio, Real const near, Real const far)
Definition: matrices.h:319
typename common_type_impl< Ts... >::type common_type
Definition: common_type.h:23
Interface for camera implementations.
Definition: camera.h:19
auto constexpr eye() const -> auto
Definition: camera.h:78
auto constexpr aspect_ratio() const
Definition: camera.h:74
Mat4< Real > mat4
Definition: camera.h:28
auto set_projection_matrix(mat4 const &projection_matrix) -> void
Definition: camera.h:280
Vec3< Real > vec3
Definition: camera.h:26
Perspective cameras are able to cast rays from one point called 'eye' through an image plane.
Definition: perspective_camera.h:15
auto constexpr eye() const -> auto
Definition: camera.h:78
constexpr perspective_camera(vec3 const &eye, vec3 const &lookat, Real fov, Real const near, Real const far, std::size_t const res_x, std::size_t const res_y)
Definition: perspective_camera.h:45
perspective_camera(perspective_camera const &)=default
constexpr perspective_camera(vec3 const &eye, vec3 const &lookat, vec3 const &up, Real const fov, Real const near, Real const far, std::size_t const res_x, std::size_t const res_y)
Definition: perspective_camera.h:31
constexpr perspective_camera(vec< EyeReal, 3 > const &eye, vec< LookatReal, 3 > const &lookat, vec< UpReal, 3 > const &up, FovReal const fov, std::size_t const res_x, std::size_t const res_y)
Definition: perspective_camera.h:62
Real real_type
Definition: perspective_camera.h:17
perspective_camera(perspective_camera &&) noexcept=default
constexpr perspective_camera(vec3 const &eye, vec3 const &lookat, Real fov, std::size_t const res_x, std::size_t const res_y)
Definition: perspective_camera.h:53