From bb779b237a1846872849c2bf5a7d39b68b254788 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 8 Apr 2019 23:01:06 -0700 Subject: [PATCH] 3d-viewer: Refresh raytracing on rotate (cherry picked from commit 89d2e67e4571200b3472936a279224dc1aa35da7) --- 3d-viewer/3d_viewer/eda_3d_viewer.cpp | 42 +++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index b991dee426..1c470cd3d9 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -291,32 +291,62 @@ void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event ) case ID_ROTATE3D_X_POS: m_settings.CameraGet().RotateX( glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_ROTATE3D_X_NEG: m_settings.CameraGet().RotateX( -glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_ROTATE3D_Y_POS: m_settings.CameraGet().RotateY( glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_ROTATE3D_Y_NEG: m_settings.CameraGet().RotateY( -glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_ROTATE3D_Z_POS: m_settings.CameraGet().RotateZ( glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_ROTATE3D_Z_NEG: m_settings.CameraGet().RotateZ( -glm::radians(ROT_ANGLE) ); - m_canvas->Request_refresh(); + + if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY ) + m_canvas->Request_refresh(); + else + m_canvas->RenderRaytracingRequest(); + break; case ID_MOVE3D_LEFT: