After merge fixes
This commit is contained in:
parent
2ac3861b2a
commit
dda346b70a
4 changed files with 22 additions and 25 deletions
|
@ -403,7 +403,9 @@ bool GLGizmoBase::use_grabbers(const wxMouseEvent &mouse_event) {
|
|||
}
|
||||
|
||||
if (mouse_event.LeftDown()) {
|
||||
Selection &selection = m_parent.get_selection();
|
||||
Selection &selection = m_parent.get_selection();
|
||||
if (!selection.is_empty() && m_hover_id != -1 &&
|
||||
(m_grabbers.empty() || m_hover_id < static_cast<int>(m_grabbers.size()))) {
|
||||
selection.setup_cache();
|
||||
|
||||
m_dragging = true;
|
||||
|
|
|
@ -214,8 +214,8 @@ std::string GLGizmoCut3D::get_tooltip() const
|
|||
}
|
||||
if (tooltip.empty() && (m_hover_id == X || m_hover_id == Y)) {
|
||||
std::string axis = m_hover_id == X ? "X" : "Y";
|
||||
// return axis + ": " + format(float(Geometry::rad2deg(Geometry::Transformation(m_rotation_m).get_rotation()[m_hover_id])), 1) + _u8L("°");
|
||||
return axis + ": " + format(float(Geometry::rad2deg(m_angle)), 1) + _u8L("°");
|
||||
// return axis + ": " + format(float(Geometry::rad2deg(Geometry::Transformation(m_rotation_m).get_rotation()[m_hover_id])), 1) + _u8L("°");
|
||||
return axis + ": " + format(float(Geometry::rad2deg(m_angle)), 1) + _u8L("°");
|
||||
}
|
||||
|
||||
return tooltip;
|
||||
|
@ -608,12 +608,10 @@ void GLGizmoCut3D::render_cut_center_graber(bool picking /* = false*/)
|
|||
return;
|
||||
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
glsafe(::glLineWidth(m_hover_id != -1 ? 2.0f : 1.5f));
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
if (!m_grabber_connection.is_initialized() || is_changed) {
|
||||
m_grabber_connection.reset();
|
||||
glsafe(::glLineWidth(m_hover_id != -1 ? 2.0f : 1.5f));
|
||||
|
||||
ColorRGBA color = picking ? picking_decode(BASE_ID - Z) :
|
||||
m_hover_id == Z ? complementary(GRABBER_COLOR) : GRABBER_COLOR;
|
||||
|
||||
|
@ -753,7 +751,7 @@ void GLGizmoCut3D::render_cut_line()
|
|||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
shader->set_uniform("view_model_matrix", camera.get_view_matrix());
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
|
||||
m_cut_line.reset();
|
||||
m_cut_line.init_from(its_make_line((Vec3f)m_line_beg.cast<float>(), (Vec3f)m_line_end.cast<float>()));
|
||||
|
||||
|
@ -822,26 +820,32 @@ void GLGizmoCut3D::on_set_state()
|
|||
}
|
||||
else
|
||||
m_c->object_clipper()->release();
|
||||
#endif // !ENABLE_GL_CORE_PROFILE
|
||||
|
||||
force_update_clipper_on_render = m_state == On;
|
||||
}
|
||||
|
||||
#if ENABLE_RAYCAST_PICKING
|
||||
void GLGizmoCut::on_register_raycasters_for_picking()
|
||||
void GLGizmoCut3D::on_register_raycasters_for_picking()
|
||||
{
|
||||
// the gizmo grabbers are rendered on top of the scene, so the raytraced picker should take it into account
|
||||
m_parent.set_raycaster_gizmos_on_top(true);
|
||||
}
|
||||
|
||||
void GLGizmoCut::on_unregister_raycasters_for_picking()
|
||||
void GLGizmoCut3D::on_unregister_raycasters_for_picking()
|
||||
{
|
||||
m_parent.set_raycaster_gizmos_on_top(false);
|
||||
}
|
||||
#else
|
||||
void GLGizmoCut3D::on_render_for_picking()
|
||||
{
|
||||
render_cut_center_graber(true);
|
||||
render_connectors(true);
|
||||
}
|
||||
#endif // ENABLE_RAYCAST_PICKING
|
||||
|
||||
void GLGizmoCut3D::on_set_hover_id()
|
||||
{
|
||||
}
|
||||
#endif // ENABLE_RAYCAST_PICKING
|
||||
|
||||
bool GLGizmoCut3D::on_is_activable() const
|
||||
{
|
||||
|
@ -1139,12 +1143,6 @@ void GLGizmoCut3D::on_render()
|
|||
render_cut_line();
|
||||
}
|
||||
|
||||
void GLGizmoCut3D::on_render_for_picking()
|
||||
{
|
||||
render_cut_center_graber(true);
|
||||
render_connectors(true);
|
||||
}
|
||||
|
||||
void GLGizmoCut3D::on_render_input_window(float x, float y, float bottom_limit)
|
||||
{
|
||||
static float last_y = 0.0f;
|
||||
|
|
|
@ -106,7 +106,6 @@ class GLGizmoCut3D : public GLGizmoBase
|
|||
, cutGrig
|
||||
//,cutRadial
|
||||
//,cutModular
|
||||
std::vector<Transform3d> volumes_trafos;
|
||||
};
|
||||
|
||||
enum class CutConnectorMode {
|
||||
|
|
|
@ -127,11 +127,9 @@ void MeshClipper::render_contour()
|
|||
GLShaderProgram* shader = wxGetApp().get_shader("flat");
|
||||
if (shader != nullptr) {
|
||||
shader->start_using();
|
||||
#if ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
shader->set_uniform("view_model_matrix", camera.get_view_matrix());
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
m_model_expanded.set_color(color);
|
||||
m_model_expanded.render();
|
||||
shader->stop_using();
|
||||
|
@ -418,7 +416,7 @@ bool MeshRaycaster::unproject_on_mesh(const Vec2d& mouse_pos, const Transform3d&
|
|||
Vec3d direction;
|
||||
line_from_mouse_pos(mouse_pos, trafo, camera, point, direction);
|
||||
|
||||
std::vector<sla::IndexedMesh::hit_result> hits = m_emesh.query_ray_hits(point, direction);
|
||||
std::vector<AABBMesh::hit_result> hits = m_emesh.query_ray_hits(point, direction);
|
||||
|
||||
if (hits.empty())
|
||||
return false; // no intersection found
|
||||
|
@ -434,8 +432,8 @@ bool MeshRaycaster::is_valid_intersection(Vec3d point, Vec3d direction, const Tr
|
|||
{
|
||||
point = trafo.inverse() * point;
|
||||
|
||||
std::vector<sla::IndexedMesh::hit_result> hits = m_emesh.query_ray_hits(point, direction);
|
||||
std::vector<sla::IndexedMesh::hit_result> neg_hits = m_emesh.query_ray_hits(point, -direction);
|
||||
std::vector<AABBMesh::hit_result> hits = m_emesh.query_ray_hits(point, direction);
|
||||
std::vector<AABBMesh::hit_result> neg_hits = m_emesh.query_ray_hits(point, -direction);
|
||||
|
||||
return !hits.empty() && !neg_hits.empty();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue