reverted is out of bounds check + added extra test

This commit is contained in:
2025-12-09 10:06:25 +03:00
parent 3744a6cdec
commit ff35571231
2 changed files with 13 additions and 10 deletions

View File

@@ -242,16 +242,7 @@ namespace omath::projection
template<class Type>
[[nodiscard]] constexpr static bool is_ndc_out_of_bounds(const Type& ndc) noexcept
{
const auto& raw_array = ndc.raw_array();
if (raw_array[2] < 0.f || raw_array[2] > 1.f)
return true;
for (std::size_t i = 0; i < 2; i++)
if (raw_array[i] < -1.f || raw_array[i] > 1.f)
return true;
return false;
return std::ranges::any_of(ndc.raw_array(), [](const auto& val) { return val < -1 || val > 1; });
}
// NDC REPRESENTATION: