diff options
Diffstat (limited to 'tests/manual/qardboard/PlacedEntity.qml')
-rw-r--r-- | tests/manual/qardboard/PlacedEntity.qml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/manual/qardboard/PlacedEntity.qml b/tests/manual/qardboard/PlacedEntity.qml new file mode 100644 index 000000000..075bfd48d --- /dev/null +++ b/tests/manual/qardboard/PlacedEntity.qml @@ -0,0 +1,35 @@ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import Qt3D.Core 2.0 +import Qt3D.Render 2.0 +import Qt3D.Extras 2.0 + +Entity { + id: root + property double angle: 0 + property double radius: 10 + property var mesh + property alias color: material.diffuse + property vector3d center: Qt.vector3d(0, 0, 0) + + components: [ + Transform { + id: tr + matrix: { + var ra = 0// (root.angle) * Math.PI / 180 + var m = Qt.matrix4x4() + m.rotate(root.angle, Qt.vector3d(0, 1, 0)) + m.translate(Qt.vector3d(root.center.x + root.radius * Math.sin(ra), root.center.y, root.center.z - root.radius * Math.cos(ra))) + return m + } + } + ] + + Entity { + PhongMaterial { + id: material + } + components: [ material, mesh ] + } +} |