Scale gizmo interaction with mouse

This commit is contained in:
Enrico Turri 2018-06-15 14:10:28 +02:00
parent 52a7d7ed09
commit 6874949556
5 changed files with 263 additions and 94 deletions

View file

@ -340,6 +340,7 @@ public:
typedef std::map<EType, GLGizmoBase*> GizmosMap;
GizmosMap m_gizmos;
EType m_current;
bool m_dragging;
public:
Gizmos();
@ -357,6 +358,12 @@ public:
void set_hover_id(int id);
bool overlay_contains_mouse(const GLCanvas3D& canvas, const Pointf& mouse_pos) const;
bool grabber_contains_mouse() const;
void update(const Pointf& mouse_pos);
bool is_dragging() const;
void start_dragging();
void stop_dragging();
void render(const GLCanvas3D& canvas, const BoundingBoxf3& box) const;
void render_current_gizmo_for_picking_pass(const BoundingBoxf3& box) const;
@ -368,6 +375,7 @@ public:
void _render_current_gizmo(const BoundingBoxf3& box) const;
float _get_total_overlay_height() const;
GLGizmoBase* _get_current() const;
};
private:
@ -587,6 +595,9 @@ private:
// If the Z screen space coordinate is not provided, a depth buffer value is substituted.
Pointf3 _mouse_to_3d(const Point& mouse_pos, float* z = nullptr);
// Convert the screen space coordinate to world coordinate on the bed.
Pointf3 _mouse_to_bed_3d(const Point& mouse_pos);
void _start_timer();
void _stop_timer();