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 ) ...@@ -1787,24 +1787,16 @@ void GLViewer::wheelEvent( QWheelEvent* evt )
{ {
setFovY( fovY() + evt->delta()*M_PI/180.0f ); 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(); float &planeFactor = m_ChangeNearPlaneMode? m_View.nearPlaneFactor : m_View.farPlaneFactor;
if( m_View.nearPlaneFactor + delta > 0.0 ) float &plane = m_ChangeNearPlaneMode? m_View.zNear : m_View.zFar;
{
m_View.nearPlaneFactor += delta; double delta = 0.0005 * planeFactor * evt->delta();
m_View.zNear = m_View.nearPlaneFactor * m_View.distToFocusPoint; if( planeFactor + delta > 0.0 )
m_MustUpdateProjectionMatrix = true;
update();
}
}
else if( m_ChangeFarPlaneMode )
{
double delta = 0.0005 * m_View.farPlaneFactor * evt->delta();
if( m_View.farPlaneFactor + delta > 0.0 )
{ {
m_View.farPlaneFactor += delta; planeFactor += delta;
m_View.zFar = m_View.farPlaneFactor * m_View.distToFocusPoint; plane = planeFactor * m_View.distToFocusPoint;
m_MustUpdateProjectionMatrix = true; m_MustUpdateProjectionMatrix = true;
update(); 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