| 23 #include <QMessageBox> |
23 #include <QMessageBox> |
| 24 #include <QAbstractButton> |
24 #include <QAbstractButton> |
| 25 #include "geometry.h" |
25 #include "geometry.h" |
| 26 #include "partrenderer.h" |
26 #include "partrenderer.h" |
| 27 #include "model.h" |
27 #include "model.h" |
| |
28 #include "gl/compiler.h" |
| 28 |
29 |
| 29 static constexpr double MIN_ZOOM = -3.0; |
30 static constexpr double MIN_ZOOM = -3.0; |
| 30 static constexpr double MAX_ZOOM = 3.0; |
31 static constexpr double MAX_ZOOM = 3.0; |
| 31 QOpenGLFunctions glfunc; |
32 QOpenGLFunctions glfunc; |
| 32 |
33 |
| 350 this->viewMatrix * glm::mat4_cast(this->modelQuaternion), |
351 this->viewMatrix * glm::mat4_cast(this->modelQuaternion), |
| 351 this->projectionMatrix, |
352 this->projectionMatrix, |
| 352 viewportVector); |
353 viewportVector); |
| 353 } |
354 } |
| 354 |
355 |
| 355 ldraw::id_t PartRenderer::pick(QPoint where) |
356 ModelId PartRenderer::pick(QPoint where) |
| 356 { |
357 { |
| 357 // y is flipped, take that into account |
358 // y is flipped, take that into account |
| 358 where.setY(this->height() - where.y()); |
359 where.setY(this->height() - where.y()); |
| 359 // Since we are dealing with pixel data right from the framebuffer, its size |
360 // Since we are dealing with pixel data right from the framebuffer, its size |
| 360 // will be affected by High DPI scaling. We need to take this into account |
361 // will be affected by High DPI scaling. We need to take this into account |