Debian Codegraph @

tests/auto/render/pickboundingvolumejob/testscene_parententity.qml

raw
1 // Copyright (C) 2017 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.Extras 2.0
7 import QtQuick.Window 2.0
8
9 Entity {
10 id: sceneRoot
11
12 Window {
13 id: win
14 width: 600
15 height: 600
16 visible: true
17 }
18
19 Camera {
20 id: camera
21 projectionType: CameraLens.PerspectiveProjection
22 fieldOfView: 45
23 nearPlane : 0.1
24 farPlane : 1000.0
25 position: Qt.vector3d( 0.0, 0.0, -40.0 )
26 upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
27 viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
28 }
29
30 components: [
31 RenderSettings {
32 Viewport {
33 normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
34
35 RenderSurfaceSelector {
36
37 surface: win
38
39 ClearBuffers {
40 buffers : ClearBuffers.ColorDepthBuffer
41 NoDraw {}
42 }
43
44 CameraSelector {
45 camera: camera
46 }
47 }
48 }
49 }
50 ]
51
52 CuboidMesh { id: cubeMesh }
53 PhongMaterial { id: material }
54
55 // Parent Entity
56 Entity {
57
58 Entity {
59 components: [
60 PlaneMesh {
61 width: 100
62 height: 100
63 },
64 PhongMaterial {
65 }
66 ]
67 }
68
69 // Child Entity
70 Entity {
71 property Transform transform: Transform {
72 translation: Qt.vector3d(-5, 0, 0)
73 scale: 2.0
74 }
75
76 property ObjectPicker picker: ObjectPicker {
77 objectName: "Picker"
78 dragEnabled: true
79 }
80
81 components: [cubeMesh, material, transform, picker]
82 }
83 }
84
85 }