File: Screen01.ui.qml

package info (click to toggle)
qt6-quick3d 6.8.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140,860 kB
  • sloc: cpp: 380,464; ansic: 36,078; xml: 252; sh: 241; makefile: 29
file content (125 lines) | stat: -rw-r--r-- 2,965 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Controls
import QtQuick3D
import QtQuick.Layouts
import QtQuick3D.Helpers
import VirtualAssistant.Constants
import Quick3DAssets.VirtualAssistant

Rectangle {
    width: Constants.width
    height: Constants.height

    View3D {
        id: view3D
        anchors.fill: parent

        environment: ExtendedSceneEnvironment {
            backgroundMode: SceneEnvironment.SkyBox
            lightProbe: Texture { source: Constants.sceneName }
            antialiasingMode: SceneEnvironment.MSAA
            antialiasingQuality: SceneEnvironment.VeryHigh
            fxaaEnabled: true
            probeExposure: 0.6
            probeOrientation: Qt.vector3d(0, settingsPanel.skyboxRotation, 0)
            specularAAEnabled: true
            tonemapMode: SceneEnvironment.TonemapModeLinear
            vignetteEnabled: true
            vignetteRadius: 0.15
        }

        Node {
            id: scene

            VirtualAssistant {
                id: virtualAssistant
            }
        }

        Node {
            id: cameraNode
            PerspectiveCamera {
                id: sceneCamera
                y: 5
                z: 15
                fieldOfView: settingsPanel.cameraFov
                clipNear: 1.0
            }
        }

        OrbitCameraController {
            anchors.fill: parent
            origin: cameraNode
            camera: sceneCamera
            enabled: settingsPanel.cameraControllerEnabled
        }

        MouseArea {
            anchors.fill: parent

            Connections {
                function onClicked(mouse) {
                    var result = view3D.pick(mouse.x, mouse.y);

                    if (!result.objectHit)
                        return

                    virtualAssistant.animateObject(result.objectHit.objectName)
                }
            }
        }
    }

    Item {
        id: __materialLibrary__
        DefaultMaterial {
            id: defaultMaterial
            objectName: "Default Material"
            diffuseColor: "#4aee45"
        }
    }

    TabBar {
        id: bar
        anchors.left: parent.left
        anchors.top: parent.top
        width: 300

        TabButton {
            text: qsTr("Animations")
        }
        TabButton {
            text: qsTr("Settings")
        }
    }

    StackLayout {
        anchors.top: bar.bottom
        anchors.bottom: parent.bottom
        width: bar.width

        currentIndex: bar.currentIndex

        ControlPanel {
            id: controlPanel

            Connections {
                target: controlPanel
                function onClicked(index: int) {
                    virtualAssistant.runAnimation(index);
                }
            }
        }

        SettingsPanel {
            id: settingsPanel

            camera: sceneCamera
        }
    }
}