Debian Codegraph @

usecases/InlineFrameGraphConfiguration.qml

raw
1 // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4 import QtQuick 2.1 as QQ2
5 import Qt3D 2.0
6
7 Node {
8 // Node can contains any type of Node or QObject
9 id : root
10 objectName : "root"
11
12 // Entity can be composed of components and children entities
13 // that inherit its attributes (transformations, framegraph rendering)
14 Entity {
15 id : sceneRoot
16 objectName : sceneRoot
17
18 property FrameGraph frameGraph : FrameGraph { // subclass of Component
19 // activeFrameGraph: references the frameGraph
20 // configuration
21 activeFrameGraph : FrameGraphConfiguration {
22
23 TechniqueFilter {
24
25 Viewport {
26 viewportRect : Qt.rect(0,0,1,1)
27
28 CameraSelector {
29 camera : camera1 // Problem here, we cannot reference an Entity
30 }
31 }
32 }
33 }
34 }
35
36 // Cameras are Entity composed of an Optic component called Camera
37 Entity {
38 id : camera1
39 objectName : "camera1"
40
41 // Transform is a component
42 // Contains transformation childComponents
43 property Transform transform : Transform {
44 LookAt {}
45 Translate {}
46 Scale {}
47 Rotate {}
48 }
49
50 property Camera optics : Camera {
51 projectionType: Camera.PerspectiveProjection
52 fieldOfView: 22.5
53 aspectRatio: 1920.0 / 1080.0
54 }
55 }
56
57 Entity {
58 id : testMesh
59 objectName : "testMesh"
60
61 property Mesh mesh : Mesh { // subclass of Component
62 source : "test_mesh.obj"
63 }
64
65 property Material material : Material { // subclass of Component
66 diffuseColor : "#00ff00"
67 specularColor : "#00ff00"
68 }
69 }
70
71
72 } // sceneRoot
73
74 } // root