diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-06-14 11:38:09 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-06-14 11:38:09 +0300 |
commit | 1a91add2e60f3a4d22cdd6c8a10e57dc8095e0a2 (patch) | |
tree | 711eca9fdaeb3e304ba91667f00eaad21bab61a3 /src/slic3r/GUI/3DBed.hpp | |
parent | a99466ef1df99d52277a5f78a4fbb5481d2dd584 (diff) |
Tighter camera frustrum to reduce z-fighting
Diffstat (limited to 'src/slic3r/GUI/3DBed.hpp')
-rw-r--r-- | src/slic3r/GUI/3DBed.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index e60cdf94e..79e96fdf0 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -85,7 +85,9 @@ public: private: EType m_type; Pointfs m_shape; - BoundingBoxf3 m_bounding_box; + mutable BoundingBoxf3 m_bounding_box; + mutable BoundingBoxf3 m_extended_bounding_box; + mutable bool m_extended_bounding_box_dirty; Polygon m_polygon; GeometryBuffer m_triangles; GeometryBuffer m_gridlines; @@ -117,7 +119,7 @@ public: // Return true if the bed shape changed, so the calee will update the UI. bool set_shape(const Pointfs& shape); - const BoundingBoxf3& get_bounding_box() const { return m_bounding_box; } + const BoundingBoxf3& get_bounding_box(bool extended) const { return extended ? m_extended_bounding_box : m_bounding_box; } bool contains(const Point& point) const; Point point_projection(const Point& point) const; @@ -125,7 +127,7 @@ public: void render_axes() const; private: - void calc_bounding_box(); + void calc_bounding_boxes() const; void calc_triangles(const ExPolygon& poly); void calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox); EType detect_type(const Pointfs& shape) const; |