Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit f232b9ad authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Changing of near and far planes distances optimized.

parent ae7dbc8a
......@@ -1787,24 +1787,16 @@ void GLViewer::wheelEvent( QWheelEvent* evt )
{
setFovY( fovY() + evt->delta()*M_PI/180.0f );
}
else if( m_ChangeNearPlaneMode )
else if( m_ChangeNearPlaneMode || m_ChangeFarPlaneMode )
{
double delta = 0.0005 * m_View.nearPlaneFactor * evt->delta();
if( m_View.nearPlaneFactor + delta > 0.0 )
{
m_View.nearPlaneFactor += delta;
m_View.zNear = m_View.nearPlaneFactor * m_View.distToFocusPoint;
m_MustUpdateProjectionMatrix = true;
update();
}
}
else if( m_ChangeFarPlaneMode )
{
double delta = 0.0005 * m_View.farPlaneFactor * evt->delta();
if( m_View.farPlaneFactor + delta > 0.0 )
float &planeFactor = m_ChangeNearPlaneMode? m_View.nearPlaneFactor : m_View.farPlaneFactor;
float &plane = m_ChangeNearPlaneMode? m_View.zNear : m_View.zFar;
double delta = 0.0005 * planeFactor * evt->delta();
if( planeFactor + delta > 0.0 )
{
m_View.farPlaneFactor += delta;
m_View.zFar = m_View.farPlaneFactor * m_View.distToFocusPoint;
planeFactor += delta;
plane = planeFactor * m_View.distToFocusPoint;
m_MustUpdateProjectionMatrix = true;
update();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment