mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fixed bug into Camera::set_target()
This commit is contained in:
parent
a624590b36
commit
55a4b99e44
2 changed files with 10 additions and 8 deletions
|
@ -91,14 +91,16 @@ void Camera::select_next_type()
|
|||
|
||||
void Camera::set_target(const Vec3d& target)
|
||||
{
|
||||
// We may let these factors be customizable
|
||||
static const double ScaleFactor = 1.1;
|
||||
BoundingBoxf3 test_box = m_scene_box;
|
||||
test_box.translate(-m_scene_box.center());
|
||||
// We may let this factor be customizable
|
||||
static const double ScaleFactor = 1.5;
|
||||
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));
|
||||
test_box.translate(m_scene_box.center());
|
||||
|
||||
m_target(0) = clamp(test_box.min(0), test_box.max(0), target(0));
|
||||
m_target(1) = clamp(test_box.min(1), test_box.max(1), target(1));
|
||||
m_target(2) = clamp(test_box.min(2), test_box.max(2), target(2));
|
||||
}
|
||||
|
||||
void Camera::set_theta(float theta, bool apply_limit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue