21 constexpr lookat& operator=(
lookat const&)
noexcept =
default;
22 constexpr lookat& operator=(
lookat&&)
noexcept =
default;
24 constexpr lookat(point3 camera_location, point3 lookat_location, vector3 up = vector3{0.0f, 1.0f, 0.0f}) :
25 _camera_location(camera_location), _lookat_location(lookat_location), _up(up)
29 [[nodiscard]]
constexpr operator matrix<3>()
noexcept
31 hilet f = normalize(_lookat_location - _camera_location);
32 hilet s = normalize(cross(f, _up));
33 hilet u = cross(s, f);
35 hilet eye = vector3{
static_cast<f32x4
>(_camera_location).xyz0()};
40 s.x(), u.x(), -f.x(), -dot(s, eye),
41 s.y(), u.y(), -f.y(), -dot(u, eye),
42 s.z(), u.z(), -f.z(), -dot(f, eye),
43 0.0f , 0.0f , 0.0f , 1.0f
49 point3 _camera_location;
50 point3 _lookat_location;