| 1 |
// Copyright (C) 2015 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 QtQuick 2.3 as QQ2 |
| 8 |
import Qt3D.Extras 2.0 |
| 9 |
|
| 10 |
Entity { |
| 11 |
id: root |
| 12 |
property alias position: transform.translation |
| 13 |
property alias color: material.diffuse |
| 14 |
property alias input: input |
| 15 |
|
| 16 |
PhongMaterial { id: material } |
| 17 |
|
| 18 |
SphereMesh { id: sphereMesh } |
| 19 |
|
| 20 |
Transform { |
| 21 |
id: transform |
| 22 |
scale: root.input.focus ? 2 : 1 |
| 23 |
|
| 24 |
QQ2.Behavior on scale { |
| 25 |
QQ2.NumberAnimation { |
| 26 |
duration: 250 |
| 27 |
} |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
KeyboardHandler { id: input } |
| 32 |
|
| 33 |
components: [material, sphereMesh, transform, input] |
| 34 |
} |