diff options
author | Mike Krus <mike.krus@kdab.com> | 2015-12-10 15:58:05 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2016-01-25 14:13:13 +0000 |
commit | 28ec1ca1883e0fe9b8b0e0de4049564ae652bd90 (patch) | |
tree | 3722809fc54b75d08b08fb68bd5d9d56fbe24342 /examples/qt3d | |
parent | 4ad00b344bc79e34f2ba2f8355e65c7948791389 (diff) |
Refactor picking to use one thread per entity
Added triangle visitor by refactor the triangle volume extractor
Added ability to do a ray intersection with a single volume without using a thread
Added entity collector
Use one thread for each entity
Ignore entities that don’t have a pick object
Removed list of triangle volumes stored on each entity
Use triangle visitor to test each triangle by creating a single volume on the stack
Added triangle and 3 vertex index to the pick event
Change-Id: Id3fd53549bf3ea07805426ef868df174f30e176b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d')
-rw-r--r-- | examples/qt3d/bigmodel-qml/MyEntity.qml | 7 | ||||
-rw-r--r-- | examples/qt3d/bigmodel-qml/main.qml | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/examples/qt3d/bigmodel-qml/MyEntity.qml b/examples/qt3d/bigmodel-qml/MyEntity.qml index df0dbd13d..9b2b32c5a 100644 --- a/examples/qt3d/bigmodel-qml/MyEntity.qml +++ b/examples/qt3d/bigmodel-qml/MyEntity.qml @@ -36,15 +36,20 @@ import Qt3D.Core 2.0 import Qt3D.Render 2.0 +import Qt3D.Input 2.0 Entity { id: root + property string name: "Entity" property alias position: transform.translation property alias diffuse: material.diffuse components: [ Transform { id: transform }, SphereMesh { radius: 2 }, - PhongMaterial { id: material } + PhongMaterial { id: material }, + ObjectPicker { + onClicked: console.log("Clicked", root.name, pick.distance, pick.triangleIndex) + } ] } diff --git a/examples/qt3d/bigmodel-qml/main.qml b/examples/qt3d/bigmodel-qml/main.qml index 18597f1f5..1266f8e9c 100644 --- a/examples/qt3d/bigmodel-qml/main.qml +++ b/examples/qt3d/bigmodel-qml/main.qml @@ -81,6 +81,7 @@ Entity { model: entityModel delegate: MyEntity { id: myEntity + name: "E" + index property real _lightness: 0.2 + 0.7 / collection._rows * Math.floor(index / collection.cols) property real _hue: (index % collection.cols) / collection.cols position: Qt.vector3d(collection.spacing * (index % collection.cols - 0.5 * (collection.cols - 1)), |