| 1 |
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
import Qt3D.Core 2.0 |
| 5 |
import Qt3D.Render 2.0 |
| 6 |
import Qt3D.Input 2.0 |
| 7 |
import Qt3D.Extras 2.0 |
| 8 |
|
| 9 |
Entity { |
| 10 |
id: root |
| 11 |
property string name: "Entity" |
| 12 |
property alias position: transform.translation |
| 13 |
property alias diffuse: material.diffuse |
| 14 |
|
| 15 |
components: [ |
| 16 |
Transform { id: transform }, |
| 17 |
SphereMesh { radius: 2 }, |
| 18 |
PhongMaterial { id: material }, |
| 19 |
ObjectPicker { |
| 20 |
onClicked: console.log("Clicked", root.name, pick.distance, pick.triangleIndex) |
| 21 |
} |
| 22 |
] |
| 23 |
} |