mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-15 11:44:34 +00:00
fix
This commit is contained in:
@@ -70,17 +70,17 @@ namespace omath::cry_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::ZERO_TO_ONE) noexcept
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return mat_perspective_left_handed_vertical_fov<float, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, 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>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,10 @@ namespace omath::cry_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,17 +75,17 @@ namespace omath::frostbite_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
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return mat_perspective_left_handed_vertical_fov<float, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, 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>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ namespace omath::frostbite_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,18 +75,18 @@ namespace omath::opengl_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
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::NEGATIVE_ONE_TO_ONE)
|
||||
return mat_perspective_right_handed_vertical_fov<
|
||||
float, MatStoreType::COLUMN_MAJOR, NDCDepthRange::NEGATIVE_ONE_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return mat_perspective_right_handed_vertical_fov<
|
||||
float, MatStoreType::COLUMN_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
@@ -32,9 +32,10 @@ namespace omath::opengl_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -76,17 +76,17 @@ namespace omath::rage_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::ZERO_TO_ONE) noexcept
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return mat_perspective_left_handed_vertical_fov<float, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, 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>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ namespace omath::rage_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace omath::source_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;
|
||||
@@ -79,11 +79,11 @@ namespace omath::source_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::source_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,17 +75,17 @@ namespace omath::unity_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
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return omath::mat_perspective_right_handed_vertical_fov<
|
||||
float, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
if (ndc_depth_range == NDCDepthRange::NEGATIVE_ONE_TO_ONE)
|
||||
return omath::mat_perspective_right_handed_vertical_fov<
|
||||
float, MatStoreType::ROW_MAJOR, NDCDepthRange::NEGATIVE_ONE_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ namespace omath::unity_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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,17 +75,17 @@ namespace omath::unreal_engine
|
||||
|
||||
[[nodiscard]]
|
||||
inline OMATH_CONSTEXPR Mat4X4 calc_perspective_projection_matrix(
|
||||
const double field_of_view, const double aspect_ratio, const double near, const double far,
|
||||
const double field_of_view, const double aspect_ratio, const double near_plane, const double far_plane,
|
||||
const NDCDepthRange ndc_depth_range = NDCDepthRange::NEGATIVE_ONE_TO_ONE) noexcept
|
||||
{
|
||||
if (ndc_depth_range == NDCDepthRange::ZERO_TO_ONE)
|
||||
return mat_perspective_left_handed_horizontal_fov<
|
||||
double, MatStoreType::ROW_MAJOR, NDCDepthRange::ZERO_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
if (ndc_depth_range == NDCDepthRange::NEGATIVE_ONE_TO_ONE)
|
||||
return mat_perspective_left_handed_horizontal_fov<
|
||||
double, MatStoreType::ROW_MAJOR, NDCDepthRange::NEGATIVE_ONE_TO_ONE>(
|
||||
field_of_view, aspect_ratio, near, far);
|
||||
field_of_view, aspect_ratio, near_plane, far_plane);
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ namespace omath::unreal_engine
|
||||
[[nodiscard]]
|
||||
OMATH_CONSTEXPR static Mat4X4
|
||||
calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
||||
const double near, const double far, const NDCDepthRange ndc_depth_range) noexcept
|
||||
const double near_plane, const double 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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user