updated for unreal

This commit is contained in:
2026-04-25 04:42:52 +03:00
parent 180f2f2afa
commit 0487e285ef
12 changed files with 104 additions and 96 deletions
+9 -9
View File
@@ -714,13 +714,13 @@ namespace omath
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR,
NDCDepthRange DepthRange = NDCDepthRange::NEGATIVE_ONE_TO_ONE>
[[nodiscard]]
Mat<4, 4, Type, St> mat_perspective_left_handed_horizontal_fov(const float horizontal_fov,
const float aspect_ratio, const float near,
const float far) noexcept
Mat<4, 4, Type, St> mat_perspective_left_handed_horizontal_fov(const Type horizontal_fov,
const Type aspect_ratio, const Type near,
const Type far) noexcept
{
const float inv_tan_half_hfov = 1.f / std::tan(angles::degrees_to_radians(horizontal_fov) / 2.f);
const float x_axis = inv_tan_half_hfov;
const float y_axis = inv_tan_half_hfov * aspect_ratio;
const auto inv_tan_half_hfov = 1.f / std::tan(angles::degrees_to_radians(horizontal_fov) / 2.f);
const auto x_axis = inv_tan_half_hfov;
const auto y_axis = inv_tan_half_hfov / aspect_ratio;
if constexpr (DepthRange == NDCDepthRange::ZERO_TO_ONE)
return {{x_axis, 0.f, 0.f, 0.f},
@@ -739,9 +739,9 @@ namespace omath
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR,
NDCDepthRange DepthRange = NDCDepthRange::NEGATIVE_ONE_TO_ONE>
[[nodiscard]]
Mat<4, 4, Type, St> mat_perspective_right_handed_horizontal_fov(const float horizontal_fov,
const float aspect_ratio, const float near,
const float far) noexcept
Mat<4, 4, Type, St> mat_perspective_right_handed_horizontal_fov(const Type horizontal_fov,
const Type aspect_ratio, const Type near,
const Type far) noexcept
{
const float inv_tan_half_hfov = 1.f / std::tan(angles::degrees_to_radians(horizontal_fov) / 2.f);
const float x_axis = inv_tan_half_hfov;