8#include "../utility/module.hpp"
10namespace hi {
inline namespace v1 {
31 perspective(
float fov_y,
float aspect_ratio,
float znear,
float zfar) noexcept :
32 _tan_half_fov_y(
std::tan(fov_y * 0.5f)), _aspect_ratio(aspect_ratio), _znear(znear), _zfar(zfar)
47 perspective(fov_y, view_port.width() / view_port.height(), znear, zfar)
51 [[nodiscard]]
constexpr operator matrix3() noexcept
53 hilet a = _aspect_ratio;
54 hilet t = _tan_half_fov_y;
60 1.0f / (a * t), 0.0f , 0.0f , 0.0f,
61 0.0f , 1.0f / t, 0.0f , 0.0f,
62 0.0f , 0.0f , f / (n - f), -(f * n) / (f - n),
63 0.0f , 0.0f , -1.0f , 0.0f
69 float _tan_half_fov_y;
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
A high-level geometric extent.
Definition extent2.hpp:26
A 2D or 3D homogenius matrix for transforming homogenious vectors and points.
Definition matrix3.hpp:29
Perspective transform.
Definition perspective.hpp:15
perspective(float fov_y, float aspect_ratio, float znear, float zfar) noexcept
Create a right-handed perspective transform.
Definition perspective.hpp:31
perspective(float fov_y, extent2 view_port, float znear, float zfar) noexcept
Create a right-handed perspective transform.
Definition perspective.hpp:46