29 constexpr lookat& operator=(
lookat const&)
noexcept =
default;
30 constexpr lookat& operator=(
lookat&&)
noexcept =
default;
32 constexpr lookat(point3 camera_location, point3 lookat_location,
vector3 up =
vector3{0.0f, 1.0f, 0.0f}) :
33 _camera_location(camera_location), _lookat_location(lookat_location), _up(up)
37 [[nodiscard]]
constexpr operator matrix3()
noexcept
39 auto const f = normalize(_lookat_location - _camera_location);
40 auto const s = normalize(cross(f, _up));
41 auto const u = cross(s, f);
43 auto const eye =
vector3{
static_cast<f32x4>(_camera_location).xyz0()};
48 s.x(), u.x(), -f.x(), -dot(s, eye),
49 s.y(), u.y(), -f.y(), -dot(u, eye),
50 s.z(), u.z(), -f.z(), -dot(f, eye),
51 0.0f , 0.0f , 0.0f , 1.0f
57 point3 _camera_location;
58 point3 _lookat_location;
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector3.hpp:26