Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2020-01-17 11:36:34 +0300
committerEnrico Turri <enricoturri@seznam.cz>2020-01-17 11:36:34 +0300
commit02aa6294494bc491e0a3294a6c301c24c2574297 (patch)
tree94b57007bf45e160bd63443589244e171e690f82 /src/slic3r/GUI/Camera.cpp
parent34aac7e292722c3ce27095ad9230aad46624d45f (diff)
3DConnexion devices -> Tweak of sensitivity parameters and dependency of translation from zoom factor
Diffstat (limited to 'src/slic3r/GUI/Camera.cpp')
-rw-r--r--src/slic3r/GUI/Camera.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/slic3r/GUI/Camera.cpp b/src/slic3r/GUI/Camera.cpp
index f2a560c08..c21947d58 100644
--- a/src/slic3r/GUI/Camera.cpp
+++ b/src/slic3r/GUI/Camera.cpp
@@ -143,13 +143,14 @@ void Camera::update_zoom(double delta_zoom)
void Camera::set_zoom(double zoom)
{
// Don't allow to zoom too far outside the scene.
- double zoom_min = calc_zoom_to_bounding_box_factor(m_scene_box, (int)m_viewport[2], (int)m_viewport[3]);
+ double zoom_min = min_zoom();
if (zoom_min > 0.0)
- zoom = std::max(zoom, zoom_min * 0.7);
+ zoom = std::max(zoom, zoom_min);
// Don't allow to zoom too close to the scene.
- m_zoom = std::min(zoom, 100.0);
+ m_zoom = std::min(zoom, max_zoom());
}
+
#if ENABLE_6DOF_CAMERA
void Camera::select_view(const std::string& direction)
{
@@ -457,9 +458,9 @@ void Camera::rotate_local_around_pivot(const Vec3d& rotation_rad, const Vec3d& p
translate_world(center);
}
-bool Camera::is_looking_downward() const
+double Camera::min_zoom() const
{
- return get_dir_forward().dot(Vec3d::UnitZ()) < 0.0;
+ return 0.7 * calc_zoom_to_bounding_box_factor(m_scene_box, (int)m_viewport[2], (int)m_viewport[3]);
}
#endif // ENABLE_6DOF_CAMERA