aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick3dphysics/designer/PhysicsWorldSection.qml
blob: aca954643e957080f3631987c27ddcab34bc7e1e (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme

Section {
    caption: qsTr("Physics World")
    width: parent.width

    SectionLayout {
        // Q_PROPERTY(QQuick3DNode *scene
        PropertyLabel {
            text: qsTr("Scene")
            tooltip: qsTr("The scene node to which the physics world is attached.")
        }

        SecondColumnLayout {
            ItemFilterComboBox {
                typeFilter: "QtQuick3D.Node"
                backendValue: backendValues.scene
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(QQuick3DNode *viewport
        PropertyLabel {
            text: qsTr("Viewport")
            tooltip: qsTr("The node to which the debug geometry of the physics world is added.")
        }

        SecondColumnLayout {
            ItemFilterComboBox {
                typeFilter: "QtQuick3D.Node"
                backendValue: backendValues.viewport
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(bool running)
        PropertyLabel {
            text: qsTr("Running")
            tooltip: qsTr("Whether the physics world is running.")
        }

        SecondColumnLayout {
            CheckBox {
                text: backendValues.running.valueToString
                backendValue: backendValues.running
                implicitWidth: StudioTheme.Values.twoControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(bool forceDebugDraw
        PropertyLabel {
            text: qsTr("Force Debug Draw")
            tooltip: qsTr("Whether to force debug drawing of the physics world.")
        }

        SecondColumnLayout {
            CheckBox {
                text: backendValues.forceDebugDraw.valueToString
                backendValue: backendValues.forceDebugDraw
                implicitWidth: StudioTheme.Values.twoControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(bool enableCCD
        PropertyLabel {
            text: qsTr("CCD")
            tooltip: qsTr("Whether to enable continuous collision detection.")
        }

        SecondColumnLayout {
            CheckBox {
                text: backendValues.enableCCD.valueToString
                backendValue: backendValues.enableCCD
                implicitWidth: StudioTheme.Values.twoControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(QVector3D gravity)
        PropertyLabel {
            text: qsTr("Gravity")
            tooltip: qsTr("The gravity vector.")
        }

        SecondColumnLayout {
            SpinBox {
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
                minimumValue: -9999999
                maximumValue: 9999999
                decimals: 2
                backendValue: backendValues.gravity_x
            }

            Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }

            ControlLabel {
                text: "X"
                color: StudioTheme.Values.theme3DAxisXColor
            }

            ExpandingSpacer {}
        }

        PropertyLabel {
        }

        SecondColumnLayout {
            SpinBox {
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
                minimumValue: -9999999
                maximumValue: 9999999
                decimals: 2
                backendValue: backendValues.gravity_y
            }

            Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }

            ControlLabel {
                text: "Y"
                color: StudioTheme.Values.theme3DAxisYColor
            }

            ExpandingSpacer {}
        }

        PropertyLabel {
        }

        SecondColumnLayout {
            SpinBox {
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
                minimumValue: -9999999
                maximumValue: 9999999
                decimals: 2
                backendValue: backendValues.gravity_z
            }

            Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }

            ControlLabel {
                text: "Z"
                color: StudioTheme.Values.theme3DAxisZColor
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(float typicalLength)
        PropertyLabel {
            text: qsTr("Typical Length")
            tooltip: qsTr("The typical length of objects in the scene.")
        }

        SecondColumnLayout {
            SpinBox {
                minimumValue: 0.00001
                maximumValue: 9999999
                decimals: 5
                backendValue: backendValues.typicalLength
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(float typicalSpeed
        PropertyLabel {
            text: qsTr("Typical Speed")
            tooltip: qsTr("The typical speed of objects in the scene.")
        }

        SecondColumnLayout {
            SpinBox {
                minimumValue: 0.00001
                maximumValue: 9999999
                decimals: 5
                backendValue: backendValues.typicalSpeed
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(float defaultDensity)
        PropertyLabel {
            text: qsTr("Default Density")
            tooltip: qsTr("The default density of objects in the scene.")
        }

        SecondColumnLayout {
            SpinBox {
                minimumValue: 0.00001
                maximumValue: 9999999
                decimals: 5
                backendValue: backendValues.defaultDensity
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(float minimumTimestep)
        PropertyLabel {
            text: qsTr("Min Timestep")
            tooltip: qsTr("Defines the minimum simulation timestep in milliseconds.")
        }

        SecondColumnLayout {
            SpinBox {
                minimumValue: 0.001
                maximumValue: 9999999
                decimals: 3
                backendValue: backendValues.minimumTimestep
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }

        // Q_PROPERTY(float maximumTimestep)
        PropertyLabel {
            text: qsTr("Max Timestep")
            tooltip: qsTr("Defines the maximum simulation timestep in milliseconds.")
        }

        SecondColumnLayout {
            SpinBox {
                minimumValue: 0.001
                maximumValue: 9999999
                decimals: 3
                backendValue: backendValues.maximumTimestep
                implicitWidth: StudioTheme.Values.singleControlColumnWidth
                                + StudioTheme.Values.actionIndicatorWidth
            }

            ExpandingSpacer {}
        }
    }
}