Debian Codegraph @

tests/auto/render/raycastingjob/testscene_worldraycastingalllayers.qml

raw
1 // Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 import QtQml 2.14
5 import Qt3D.Core 2.14
6 import Qt3D.Render 2.14
7 import Qt3D.Extras 2.14
8 import QtQuick.Window 2.14
9
10 Entity {
11 id: sceneRoot
12
13 Window {
14 id: win
15 width: 600
16 height: 600
17 visible: true
18 }
19
20 Camera {
21 id: camera
22 projectionType: CameraLens.PerspectiveProjection
23 fieldOfView: 45
24 aspectRatio: 16/9
25 nearPlane : 0.1
26 farPlane : 1000.0
27 position: Qt.vector3d( 0.0, 2.0, 20.0 )
28 upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
29 viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
30 }
31
32 components: [
33 RenderSettings {
34 pickingSettings.pickMethod: PickingSettings.TrianglePicking
35
36 Viewport {
37 normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
38
39 RenderSurfaceSelector {
40
41 surface: win
42
43 ClearBuffers {
44 buffers : ClearBuffers.ColorDepthBuffer
45 NoDraw {}
46 }
47
48 CameraSelector {
49 camera: camera
50 }
51 }
52 }
53 },
54 RayCaster {
55 id: caster
56 objectName: "caster"
57 length: 20
58 layers: [ parentLayer, rightEntity.layer ]
59 filterMode: RayCaster.AcceptAllMatchingLayers
60 }
61 ]
62
63 CylinderMesh {
64 id: mesh
65 radius: 1
66 length: 3
67 rings: 10
68 slices: 10
69 }
70 PhongMaterial { id: material }
71
72 Entity {
73 property Transform transform: Transform {
74 translation: Qt.vector3d(-5, 0, 0)
75 }
76
77 components: [mesh, material, transform]
78 }
79
80 Entity {
81 components: [ Layer { id: parentLayer; recursive: true } ]
82
83 Entity {
84 id: rightEntity
85
86 property Transform transform: Transform {
87 translation: Qt.vector3d(5, 0, 0)
88 }
89
90 property Layer layer: Layer { }
91
92 components: [mesh, material, transform, layer]
93 }
94 }
95 }