diff --git a/include/omath/projection/camera.hpp b/include/omath/projection/camera.hpp index c4e094b..37a3ef8 100644 --- a/include/omath/projection/camera.hpp +++ b/include/omath/projection/camera.hpp @@ -259,19 +259,8 @@ namespace omath::projection inverted_projection /= w; - const Vector3 world_pos{inverted_projection.at(0, 0), inverted_projection.at(1, 0), - inverted_projection.at(2, 0)}; - - // Validate that the computed world position is reasonable - constexpr float max_reasonable_component = 1e6f; - if (!std::isfinite(world_pos.x) || !std::isfinite(world_pos.y) || !std::isfinite(world_pos.z) - || std::abs(world_pos.x) > max_reasonable_component || std::abs(world_pos.y) > max_reasonable_component - || std::abs(world_pos.z) > max_reasonable_component) - { - return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS); - } - - return world_pos; + return Vector3{inverted_projection.at(0, 0), inverted_projection.at(1, 0), + inverted_projection.at(2, 0)}; } template