summaryrefslogtreecommitdiffstats
path: root/src/render/raycasting
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2017-04-08 16:08:24 +0200
committerMike Krus <mike.krus@kdab.com>2018-01-26 07:54:14 +0000
commit7c8410c6dc325902160bb433044800ba02d44d12 (patch)
treed41961a6d4f6993c85e746154f19c11440ab2cca /src/render/raycasting
parente680fe041700296be5e6e4a132e2cfc6f54d4e77 (diff)
Handle multiple surfaces properly for picking
This fixes issues with picking when having multiple viewports and/or multiple windows. Now check that the mouse event actually hits inside the viewport extents. Also track the source of events and check that the surface matches the source of the event. Remaining issue is overlapping viewports within the same window Task-number: QTBUG-59567 Change-Id: I76a4ee2bec7300d893fef6040d89bf81f2109795 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/raycasting')
-rw-r--r--src/render/raycasting/qray3d_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/render/raycasting/qray3d_p.h b/src/render/raycasting/qray3d_p.h
index 7c1156b76..64716307c 100644
--- a/src/render/raycasting/qray3d_p.h
+++ b/src/render/raycasting/qray3d_p.h
@@ -93,6 +93,8 @@ public:
bool operator==(const QRay3D &other) const;
bool operator!=(const QRay3D &other) const;
+ bool isValid() const { return !m_direction.isNull() && !qFuzzyIsNull(m_distance); }
+
private:
QVector3D m_origin;
QVector3D m_direction;