From 9367eb6db7f9b8b0e32ed18fac636bbd217d8438 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 16 Nov 2016 09:24:27 +0100 Subject: [PATCH] Increased the gimbal lock threshold to 170 degrees from 150 degrees. This makes it possible to look at the bottom of an object. Conflicts: lib/Slic3r/GUI/3DScene.pm --- lib/Slic3r/GUI/3DScene.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index ca662dc883..61d45f1f49 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -63,6 +63,8 @@ use constant VIEW_BOTTOM => [0.0,180.0]; use constant VIEW_FRONT => [0.0,90.0]; use constant VIEW_REAR => [180.0,90.0]; +use constant GIMBALL_LOCK_THETA_MAX => 170; + # make OpenGL::Array thread-safe { no warnings 'redefine'; @@ -252,7 +254,7 @@ sub mouse_event { if (TURNTABLE_MODE) { $self->_sphi($self->_sphi + ($pos->x - $orig->x) * TRACKBALLSIZE); $self->_stheta($self->_stheta - ($pos->y - $orig->y) * TRACKBALLSIZE); #- - $self->_stheta(150) if $self->_stheta > 150; + $self->_stheta(GIMBALL_LOCK_THETA_MAX) if $self->_stheta > GIMBALL_LOCK_THETA_MAX; $self->_stheta(0) if $self->_stheta < 0; } else { my $size = $self->GetClientSize; @@ -353,7 +355,7 @@ sub select_view { $self->_sphi($dirvec->[0]); $self->_stheta($dirvec->[1]); # Avoid gimball lock. - $self->_stheta(150) if $self->_stheta > 150; + $self->_stheta(GIMBALL_LOCK_THETA_MAX) if $self->_stheta > GIMBALL_LOCK_THETA_MAX; $self->_stheta(0) if $self->_stheta < 0; # View everything. $self->zoom_to_volumes;