mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
Fixed conflicts after merge with master + fixed rendering of hovered gizmo grabbers
This commit is contained in:
commit
f0354b43c1
31 changed files with 635 additions and 623 deletions
|
@ -1,6 +1,8 @@
|
|||
#include "libslic3r/libslic3r.h"
|
||||
#include "GLCanvas3D.hpp"
|
||||
|
||||
#include <igl/unproject.h>
|
||||
|
||||
#include "libslic3r/ClipperUtils.hpp"
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
#include "libslic3r/GCode/ThumbnailData.hpp"
|
||||
|
@ -1710,6 +1712,8 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
|
||||
_set_current();
|
||||
|
||||
m_hover_volume_idxs.clear();
|
||||
|
||||
struct ModelVolumeState {
|
||||
ModelVolumeState(const GLVolume* volume) :
|
||||
model_volume(nullptr), geometry_id(volume->geometry_id), volume_idx(-1) {}
|
||||
|
@ -4124,7 +4128,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
|
||||
shader->start_using();
|
||||
shader->set_uniform("print_box.volume_detection", 0);
|
||||
shader->set_uniform("emission_factor", 0.0);
|
||||
|
||||
for (GLVolume* vol : visible_volumes) {
|
||||
shader->set_uniform("uniform_color", (vol->printable && !vol->is_outside) ? orange : gray);
|
||||
|
@ -5606,9 +5610,9 @@ Vec3d GLCanvas3D::_mouse_to_3d(const Point& mouse_pos, float* z)
|
|||
return Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
|
||||
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
const std::array<int, 4>& viewport = camera.get_viewport();
|
||||
const Transform3d& modelview_matrix = camera.get_view_matrix();
|
||||
const Transform3d& projection_matrix = camera.get_projection_matrix();
|
||||
Matrix4d modelview = camera.get_view_matrix().matrix();
|
||||
Matrix4d projection= camera.get_projection_matrix().matrix();
|
||||
Vec4i viewport(camera.get_viewport().data());
|
||||
|
||||
GLint y = viewport[3] - (GLint)mouse_pos(1);
|
||||
GLfloat mouse_z;
|
||||
|
@ -5617,9 +5621,9 @@ Vec3d GLCanvas3D::_mouse_to_3d(const Point& mouse_pos, float* z)
|
|||
else
|
||||
mouse_z = *z;
|
||||
|
||||
GLdouble out_x, out_y, out_z;
|
||||
::gluUnProject((GLdouble)mouse_pos(0), (GLdouble)y, (GLdouble)mouse_z, (GLdouble*)modelview_matrix.data(), (GLdouble*)projection_matrix.data(), (GLint*)viewport.data(), &out_x, &out_y, &out_z);
|
||||
return Vec3d((double)out_x, (double)out_y, (double)out_z);
|
||||
Vec3d out;
|
||||
igl::unproject(Vec3d(mouse_pos(0), y, mouse_z), modelview, projection, viewport, out);
|
||||
return out;
|
||||
}
|
||||
|
||||
Vec3d GLCanvas3D::_mouse_to_bed_3d(const Point& mouse_pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue