mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
ENABLE_3DCONNEXION_DEVICES -> Slightly increased camera target movement limits
This commit is contained in:
parent
ded6d44389
commit
f4654e376e
3 changed files with 34 additions and 30 deletions
|
@ -85,10 +85,21 @@ void Camera::select_next_type()
|
|||
|
||||
void Camera::set_target(const Vec3d& target)
|
||||
{
|
||||
#if ENABLE_3DCONNEXION_DEVICES
|
||||
// We may let these factors be customizable
|
||||
static const double ScaleFactor = 1.1;
|
||||
BoundingBoxf3 test_box = m_scene_box;
|
||||
test_box.scale(ScaleFactor);
|
||||
m_target = target;
|
||||
m_target(0) = clamp(test_box.min(0), test_box.max(0), m_target(0));
|
||||
m_target(1) = clamp(test_box.min(1), test_box.max(1), m_target(1));
|
||||
m_target(2) = clamp(test_box.min(2), test_box.max(2), m_target(2));
|
||||
#else
|
||||
m_target = target;
|
||||
m_target(0) = clamp(m_scene_box.min(0), m_scene_box.max(0), m_target(0));
|
||||
m_target(1) = clamp(m_scene_box.min(1), m_scene_box.max(1), m_target(1));
|
||||
m_target(2) = clamp(m_scene_box.min(2), m_scene_box.max(2), m_target(2));
|
||||
#endif // ENABLE_3DCONNEXION_DEVICES
|
||||
}
|
||||
|
||||
void Camera::set_theta(float theta, bool apply_limit)
|
||||
|
@ -117,9 +128,7 @@ void Camera::set_zoom(double zoom)
|
|||
zoom = std::max(zoom, zoom_min * 0.7);
|
||||
|
||||
// Don't allow to zoom too close to the scene.
|
||||
zoom = std::min(zoom, 100.0);
|
||||
|
||||
m_zoom = zoom;
|
||||
m_zoom = std::min(zoom, 100.0);
|
||||
}
|
||||
#else
|
||||
void Camera::set_zoom(double zoom, const BoundingBoxf3& max_box, int canvas_w, int canvas_h)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue