From b9a17b928a288dea9753598914c0fc171b8d4484 Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Mon, 13 May 2019 22:14:15 +0100 Subject: [PATCH] Fixes lp Bug #1828747 - Add some epsilon value to ray dir on orthographic mode so they will not be zero when viewing the board com the top/bot. This was causing problems with BBox intersect function that was using invDir values. --- 3d-viewer/3d_rendering/ccamera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3d-viewer/3d_rendering/ccamera.cpp b/3d-viewer/3d_rendering/ccamera.cpp index ae442ae505..8db4ea9468 100644 --- a/3d-viewer/3d_rendering/ccamera.cpp +++ b/3d-viewer/3d_rendering/ccamera.cpp @@ -310,7 +310,7 @@ void CCAMERA::MakeRay( const SFVEC2I &aWindowPos, case PROJECTION_ORTHO: aOutOrigin = up_plus_right * 0.5f + m_frustum.nc; - aOutDirection = -m_dir; + aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON ); break; } } @@ -341,7 +341,7 @@ void CCAMERA::MakeRay( const SFVEC2F &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F & case PROJECTION_ORTHO: aOutOrigin = up_plus_right * 0.5f + m_frustum.nc; - aOutDirection = -m_dir; + aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON ); break; } }