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
|
// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.0
import QtQuick.Scene3D 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
Item {
Scene3D {
anchors.fill: parent
aspects: "input"
ParticlesScene {
id: scene
particleStep: stepSlider.value
finalCollisionFactor: collisionSlider.value
}
}
ColumnLayout {
id: colorLayout
anchors.left: parent.left
anchors.leftMargin: 35
anchors.right: parent.right
anchors.rightMargin: 35
anchors.bottom: parent.bottom
anchors.bottomMargin: 35
spacing: 15
RowLayout {
Text {
text: "Particles Step:"
color: "white"
}
Slider {
height: 35
id: stepSlider
Layout.fillWidth: true
from: 0.0
to: 2
value: 0.4
}
}
RowLayout {
Text {
text: "Particles Collision:"
color: "white"
}
Slider {
height: 35
id: collisionSlider
Layout.fillWidth: true
from: 0.0
to: 2
value: 0.2
}
}
RowLayout {
Button {
text: "Reset Particles"
onClicked: scene.reset()
}
}
RowLayout {
Text {
text: "Particles Shape:"
color: "white"
}
ButtonGroup {
exclusive: true
id: particlesTypeGroup
}
CheckBox {
text: "Sphere"
checked: true
ButtonGroup.group: particlesTypeGroup
onClicked: scene.particlesShape = scene._SPHERE
}
CheckBox
{ text: "Cube"
checked: false
ButtonGroup.group: particlesTypeGroup
onClicked: scene.particlesShape = scene._CUBE
}
CheckBox {
text: "Cylinder"
checked: false
ButtonGroup.group: particlesTypeGroup
onClicked: scene.particlesShape = scene._CYLINDER
}
CheckBox {
text: "Torus"
checked: false
ButtonGroup.group: particlesTypeGroup
onClicked: scene.particlesShape = scene._TORUS
}
}
}
}
|