Debian Codegraph @

tests/auto/render/raycastingjob/testscene_worldraycasting.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 }
59 ]
60
61 CylinderMesh {
62 id: mesh
63 radius: 1
64 length: 3
65 rings: 10
66 slices: 10
67 }
68 PhongMaterial { id: material }
69
70 Entity {
71 property Transform transform: Transform {
72 translation: Qt.vector3d(-5, 0, 0)
73 }
74
75 components: [mesh, material, transform]
76 }
77
78 Entity {
79 property Transform transform: Transform {
80 translation: Qt.vector3d(5, 0, 0)
81 }
82
83 components: [mesh, material, transform]
84 }
85 }