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.

Fixes lp:1828747
https://bugs.launchpad.net/kicad/+bug/1828747
This commit is contained in:
Mario Luzeiro 2019-05-13 23:14:15 +02:00 committed by jean-pierre charras
parent c5cd0c73a3
commit 1dab468e20
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt> * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -310,7 +310,7 @@ void CCAMERA::MakeRay( const SFVEC2I &aWindowPos,
case PROJECTION_ORTHO: case PROJECTION_ORTHO:
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc; aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
aOutDirection = -m_dir; aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
break; break;
} }
} }
@ -341,7 +341,7 @@ void CCAMERA::MakeRay( const SFVEC2F &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &
case PROJECTION_ORTHO: case PROJECTION_ORTHO:
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc; aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
aOutDirection = -m_dir; aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
break; break;
} }
} }