diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2019-01-04 13:04:29 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-01-07 08:22:51 +0000 |
commit | b7b77586301ef5cf6d168e2c890ef35a09068b76 (patch) | |
tree | b0ec3456284c01eeb54208fde6c40ea39c1f870f /tests/manual | |
parent | 7a24d64d0adca98849d161f7c2a1386d787fc4d8 (diff) |
Picking: viewport contains check needs to use pos in GL coordinate
The viewport rect is computed in GL coordinates. Therefore we need
to check if the mouse is contained with the position in GL coordinates.
The error is not noticeable unless you are using non full height viewport.
Change-Id: I1c39ff91da4a3649288826b939071a298c83c723
Task-number: QTBUG-72856
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/picking-qml/main.qml | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tests/manual/picking-qml/main.qml b/tests/manual/picking-qml/main.qml index c020d5817..5ca50be0b 100644 --- a/tests/manual/picking-qml/main.qml +++ b/tests/manual/picking-qml/main.qml @@ -79,7 +79,19 @@ Entity { id: camera2 projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 - aspectRatio: _view.width * 0.5 / _view.height + aspectRatio: _view.width * 0.5 / (_view.height * 0.5) + nearPlane : 0.1 + farPlane : 1000.0 + position: Qt.vector3d( 40.0, 5.0, -20.0 ) + upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) + viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) + } + + Camera { + id: camera3 + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 45 + aspectRatio: _view.width * 0.5 / (_view.height * 0.5) nearPlane : 0.1 farPlane : 1000.0 position: Qt.vector3d( 40.0, 5.0, -20.0 ) @@ -113,7 +125,7 @@ Entity { } Viewport { - normalizedRect: Qt.rect(0.5, 0.0, 0.5, 1.0) + normalizedRect: Qt.rect(0.5, 0.0, 0.5, 0.5) CameraSelector { camera: camera2 LayerFilter { @@ -122,6 +134,16 @@ Entity { } } } + Viewport { + normalizedRect: Qt.rect(0.5, 0.5, 0.5, 0.5) + CameraSelector { + camera: camera3 + LayerFilter { + // To show Debug volumes + layers: [sceneRoot.contentLayer, sceneRoot.debugLayer] + } + } + } } } }, |