mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added additional check
This commit is contained in:
@@ -45,6 +45,10 @@ namespace omath::projection
|
|||||||
|
|
||||||
projected /= projected.At(0, 3);
|
projected /= projected.At(0, 3);
|
||||||
|
|
||||||
|
if (projected.At(0, 0) < -1.f || projected.At(0, 0) > 1.f ||
|
||||||
|
projected.At(0, 1) < -1.f || projected.At(0, 1) > 1.f)
|
||||||
|
return std::unexpected("Projection point is out screen bounds");
|
||||||
|
|
||||||
projected *= Matrix::ToScreenMatrix(m_viewPort.m_width, m_viewPort.m_height);
|
projected *= Matrix::ToScreenMatrix(m_viewPort.m_width, m_viewPort.m_height);
|
||||||
|
|
||||||
return Vector3{projected.At(0, 0), projected.At(0, 1), projected.At(0, 2)};
|
return Vector3{projected.At(0, 0), projected.At(0, 1), projected.At(0, 2)};
|
||||||
|
|||||||
Reference in New Issue
Block a user