mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-03 03:54:04 -06:00
Add camera sanity check
This commit is contained in:
parent
83c50b2ad1
commit
8eb69b053f
1 changed files with 3 additions and 0 deletions
|
@ -586,6 +586,9 @@ double Camera::calc_zoom_to_volumes_factor(const GLVolumePtrs& volumes, Vec3d& c
|
||||||
|
|
||||||
void Camera::set_distance(double distance)
|
void Camera::set_distance(double distance)
|
||||||
{
|
{
|
||||||
|
if(distance < EPSILON || distance > 1.0e6)
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_distance != distance) {
|
if (m_distance != distance) {
|
||||||
m_view_matrix.translate((distance - m_distance) * get_dir_forward());
|
m_view_matrix.translate((distance - m_distance) * get_dir_forward());
|
||||||
m_distance = distance;
|
m_distance = distance;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue