10namespace hi {
inline namespace v1 {
32 perspective(
float fov_y,
float aspect_ratio,
float znear,
float zfar) noexcept :
33 _tan_half_fov_y(
std::tan(fov_y * 0.5f)), _aspect_ratio(aspect_ratio), _znear(znear), _zfar(zfar)
47 perspective(
float fov_y, extent2 view_port,
float znear,
float zfar) noexcept :
48 perspective(fov_y, view_port.width() / view_port.height(), znear, zfar)
52 [[nodiscard]]
constexpr operator matrix<3>() noexcept
54 hilet a = _aspect_ratio;
55 hilet t = _tan_half_fov_y;
61 1.0f / (a * t), 0.0f , 0.0f , 0.0f,
62 0.0f , 1.0f / t, 0.0f , 0.0f,
63 0.0f , 0.0f , f / (n - f), -(f * n) / (f - n),
64 0.0f , 0.0f , -1.0f , 0.0f
70 float _tan_half_fov_y;
78using perspective3 = geo::perspective;
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
Miscellaneous math functions.
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
Perspective transform.
Definition perspective.hpp:16
perspective(float fov_y, extent2 view_port, float znear, float zfar) noexcept
Create a right-handed perspective transform.
Definition perspective.hpp:47
perspective(float fov_y, float aspect_ratio, float znear, float zfar) noexcept
Create a right-handed perspective transform.
Definition perspective.hpp:32