mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-09 16:54:35 +00:00
updated for unreal
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user