33 Model* const model; |
33 Model* const model; |
34 DocumentManager* const documents; |
34 DocumentManager* const documents; |
35 const ldraw::ColorTable& colorTable; |
35 const ldraw::ColorTable& colorTable; |
36 gl::Compiler* const compiler; |
36 gl::Compiler* const compiler; |
37 ldraw::Id highlighted = ldraw::NULL_ID; |
37 ldraw::Id highlighted = ldraw::NULL_ID; |
|
38 std::optional<glm::vec3> cameraToGrid(const QPoint& point); |
|
39 QPointF worldToCamera(const glm::vec3& point); |
38 private: |
40 private: |
39 void setFragmentStyle(gl::FragmentStyle fragStyle); |
41 void setFragmentStyle(gl::FragmentStyle fragStyle); |
40 void renderAllArrays(); |
42 void renderAllArrays(); |
41 void renderScene(); |
43 void renderScene(); |
42 void updateViewMatrix(); |
44 void updateViewMatrix(); |
|
45 void updateModelMatrix(); |
|
46 void setupBackgroundColor(); |
43 QPointF lastMousePosition; |
47 QPointF lastMousePosition; |
44 gl::RenderPreferences renderPreferences; |
48 gl::RenderPreferences renderPreferences; |
45 glm::mat4 projectionMatrix; |
49 glm::mat4 projectionMatrix; |
46 glm::mat4 viewMatrix; |
50 glm::mat4 viewMatrix; |
|
51 glm::mat3 viewportMatrix; |
47 glm::quat modelQuaternion; |
52 glm::quat modelQuaternion; |
48 std::optional<GridProgram> gridProgram; |
53 std::optional<GridProgram> gridProgram; |
49 static constexpr double MIN_ZOOM = 0.0; |
54 static constexpr double MIN_ZOOM = 0.0; |
50 static constexpr double MAX_ZOOM = 3.0; |
55 static constexpr double MAX_ZOOM = 3.0; |
51 double zoom = 1.0; |
56 double zoom = 1.0; |