Skip to content

Commit

Permalink
FIX:Frustum should update when zoom changed
Browse files Browse the repository at this point in the history
jira: none
Change-Id: I13bba77c19420c2bb67f4ebeaa94860a8546b44b
(cherry picked from commit 03d9c9a1b9381e9138fc56ab7d437ce0420b5dc3)
  • Loading branch information
Haidiye00 authored and lanewei120 committed Oct 15, 2024
1 parent 1e12212 commit a44b1dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/slic3r/GUI/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void Camera::update_frustum()
float eps = 0.01;
if (m_last_eye.isApprox(eye_) && m_last_center.isApprox(center_) && m_last_up.isApprox(up_)
&& abs(m_last_near - near_) < eps && abs(m_last_far - far_) < eps &&
abs(m_last_aspect - aspect_) < eps && abs(m_last_fov - fov_) < eps) {
abs(m_last_aspect - aspect_) < eps && abs(m_last_fov - fov_) < eps && abs(m_last_zoom - m_zoom) < eps) {
return;
}
m_last_eye = eye_;
Expand All @@ -163,6 +163,7 @@ void Camera::update_frustum()
m_last_far = far_;
m_last_aspect = aspect_;
m_last_fov = fov_;
m_last_zoom = m_zoom;
Vec3f forward((center_ - eye_).normalized());
Vec3f side((forward.cross(up_)).normalized());
Vec3f up((side.cross(forward)).normalized());
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct Camera
BoundingBoxf3 m_scene_box;
Frustum m_frustum;
Vec3f m_last_eye, m_last_center, m_last_up;
float m_last_near, m_last_far, m_last_aspect, m_last_fov;
float m_last_near, m_last_far, m_last_aspect, m_last_fov,m_last_zoom;

public:
Camera() { set_default_orientation(); }
Expand Down

0 comments on commit a44b1dc

Please sign in to comment.