This commit is contained in:
2026-06-14 23:17:48 +03:00
parent 91d9335f83
commit 098be538f7
17 changed files with 54 additions and 46 deletions
+3 -3
View File
@@ -72,7 +72,7 @@ namespace omath::iw_engine
[[nodiscard]]
inline OMATH_CONSTEXPR Mat4X4 calc_perspective_projection_matrix(
const float field_of_view, const float aspect_ratio, const float near, const float far,
const float field_of_view, const float aspect_ratio, const float near_plane, const float far_plane,
const NDCDepthRange ndc_depth_range = NDCDepthRange::NEGATIVE_ONE_TO_ONE) noexcept
{
constexpr float k_source_reference_aspect = 4.f / 3.f;
@@ -80,11 +80,11 @@ namespace omath::iw_engine
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
return mat_perspective_left_handed_vertical_fov<float, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
vertical_fov, aspect_ratio, near, far);
vertical_fov, aspect_ratio, near_plane, far_plane);
if (ndc_depth_range == NDCDepthRange::NEGATIVE_ONE_TO_ONE)
return mat_perspective_left_handed_vertical_fov<float, MatStoreType::ROW_MAJOR,
NDCDepthRange::NEGATIVE_ONE_TO_ONE>(
vertical_fov, aspect_ratio, near, far);
vertical_fov, aspect_ratio, near_plane, far_plane);
std::unreachable();
}
@@ -31,9 +31,10 @@ namespace omath::iw_engine
[[nodiscard]]
OMATH_CONSTEXPR static Mat4X4
calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
const float near, const float far, const NDCDepthRange ndc_depth_range) noexcept
const float near_plane, const float far_plane,
const NDCDepthRange ndc_depth_range) noexcept
{
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near, far,
return calc_perspective_projection_matrix(fov.as_degrees(), view_port.aspect_ratio(), near_plane, far_plane,
ndc_depth_range);
}
};