mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 15:32:00 +08:00
Measuring: Measure gizmo - Further improvements in visualization of points for extended selection
This commit is contained in:
parent
7cf85a1565
commit
58da6e994c
@ -273,6 +273,7 @@ void GLGizmoMeasure::on_render()
|
|||||||
Vec3f n;
|
Vec3f n;
|
||||||
const Transform3d& trafo = it->second->get_transform();
|
const Transform3d& trafo = it->second->get_transform();
|
||||||
it->second->get_raycaster()->unproject_on_mesh(m_mouse_pos, trafo, camera, p, n);
|
it->second->get_raycaster()->unproject_on_mesh(m_mouse_pos, trafo, camera, p, n);
|
||||||
|
p = { 0.0f, 0.0f, p.z() };
|
||||||
m_curr_ex_feature_position = trafo * p.cast<double>();
|
m_curr_ex_feature_position = trafo * p.cast<double>();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -294,6 +295,10 @@ void GLGizmoMeasure::on_render()
|
|||||||
Vec3f n;
|
Vec3f n;
|
||||||
const Transform3d& trafo = it->second->get_transform();
|
const Transform3d& trafo = it->second->get_transform();
|
||||||
it->second->get_raycaster()->unproject_on_mesh(m_mouse_pos, trafo, camera, p, n);
|
it->second->get_raycaster()->unproject_on_mesh(m_mouse_pos, trafo, camera, p, n);
|
||||||
|
float angle = std::atan2(p.y(), p.x());
|
||||||
|
if (angle < 0.0f)
|
||||||
|
angle += 2.0f * float(M_PI);
|
||||||
|
p = float(radius) * Vec3f(std::cos(angle), std::sin(angle), 0.0f);
|
||||||
m_curr_ex_feature_position = trafo * p.cast<double>();
|
m_curr_ex_feature_position = trafo * p.cast<double>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user