25 constexpr lookat& operator=(
lookat const&)
noexcept =
default;
26 constexpr lookat& operator=(
lookat&&)
noexcept =
default;
28 constexpr lookat(point3 camera_location, point3 lookat_location, vector3 up = vector3{0.0f, 1.0f, 0.0f}) :
29 _camera_location(camera_location), _lookat_location(lookat_location), _up(up)
33 [[nodiscard]]
constexpr operator matrix<3>()
noexcept
35 hilet f = normalize(_lookat_location - _camera_location);
36 hilet s = normalize(cross(f, _up));
37 hilet u = cross(s, f);
39 hilet eye = vector3{
static_cast<f32x4
>(_camera_location).xyz0()};
44 s.x(), u.x(), -f.x(), -dot(s, eye),
45 s.y(), u.y(), -f.y(), -dot(u, eye),
46 s.z(), u.z(), -f.z(), -dot(f, eye),
47 0.0f , 0.0f , 0.0f , 1.0f
53 point3 _camera_location;
54 point3 _lookat_location;