mirror of https://github.com/qt/qt3d.git
Fixed picking example
Change-Id: I6255a1857d8de02bdc5f9ee6326a76b7c36d258e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
parent
ed6d778b20
commit
617e4c7686
|
@ -50,6 +50,7 @@
|
|||
|
||||
import Qt3D.Core 2.0
|
||||
import Qt3D.Render 2.0
|
||||
import Qt3D.Extras 2.0
|
||||
|
||||
Entity {
|
||||
id: root
|
||||
|
@ -64,7 +65,6 @@ Entity {
|
|||
property real z: 0
|
||||
property alias scale: transform.scale
|
||||
property alias hoverEnabled: objectPicker.hoverEnabled
|
||||
property alias recursive: debugVolume.recursive
|
||||
property alias diffuseColor: material.diffuse
|
||||
property alias ambientColor: material.ambient
|
||||
readonly property bool containsMouse: objectPicker.containsMouse
|
||||
|
@ -81,7 +81,6 @@ Entity {
|
|||
onExited: root.exited();
|
||||
}
|
||||
|
||||
BoundingVolumeDebug { id: debugVolume }
|
||||
PhongMaterial { id: material }
|
||||
|
||||
Transform {
|
||||
|
@ -94,6 +93,6 @@ Entity {
|
|||
names: "content"
|
||||
}
|
||||
|
||||
components: [mesh, material, transform, debugVolume, objectPicker, layer]
|
||||
components: [mesh, material, transform, objectPicker, layer]
|
||||
}
|
||||
|
||||
|
|
|
@ -162,9 +162,6 @@ Entity {
|
|||
onClicked: {
|
||||
console.log("Clicked cube 2")
|
||||
toggled = !toggled
|
||||
sceneItem.width = _view.width * (toggled ? .7 : .5)
|
||||
sceneItem.height = _view.height * (toggled ? .7 : .5)
|
||||
console.log(sceneItem.width, sceneItem.height)
|
||||
}
|
||||
}
|
||||
PickableEntity {
|
||||
|
@ -195,11 +192,7 @@ Entity {
|
|||
onExited: cube4.material.diffuse = "blue"
|
||||
}
|
||||
|
||||
readonly property BoundingVolumeDebug debugVolume: BoundingVolumeDebug {
|
||||
recursive: true
|
||||
}
|
||||
|
||||
components: [objectPicker, debugVolume]
|
||||
components: [objectPicker]
|
||||
|
||||
Entity {
|
||||
id: cube4
|
||||
|
@ -212,10 +205,9 @@ Entity {
|
|||
translation: Qt.vector3d(3, 4, 0)
|
||||
}
|
||||
readonly property Layer layer: Layer { names: "content" }
|
||||
readonly property BoundingVolumeDebug debugVolume: BoundingVolumeDebug {}
|
||||
readonly property PhongMaterial material: PhongMaterial { diffuse: "red" }
|
||||
|
||||
components: [cubeMesh, transform, material, debugVolume, layer]
|
||||
components: [cubeMesh, transform, material, layer]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue