Kuesa Car-Scene QML Example
import QtQuick.Scene3D 2.12
import QtQuick 2.12
import QtQuick.Controls.Material 2.12
Item {
id: mainRoot
Material.theme: Material.Dark
Material.accent: Material.Blue
Item {
id: baseUI
anchors.fill: parent
Wind {
id: wind
anchors.fill: parent
visible: menu.useOpacityMask
}
Scene3D {
id: scene3D
anchors.fill: parent
focus: true
multisample: true
aspects: ["input", "animation", "logic"]
MainScene {
id: sceneContent
screenWidth: scene3D.width
screenHeight: scene3D.height
animated: menu.idleAnimationRunning
showSkybox: menu.showSkybox
environmentMap: menu.environmentMap
environmentExposure: menu.environmentExposure
exposure: menu.exposure
carSpeed: menu.carSpeed
useOpacityMask: menu.useOpacityMask
openLeftDoor: menu.openLeftDoor
openRightDoor: menu.openRightDoor
openHood: menu.openHood
useBloomEffect: menu.useBloomEffect
}
Keys.onPressed: {
if (event.modifiers & Qt.ControlModifier) {
if (event.key === Qt.Key_F) {
_isFullScreen = !_isFullScreen
if (_isFullScreen)
_view.showFullScreen()
else
_view.show()
} else if (event.key === Qt.Key_C) {
mainMouseArea.cursorShape = mainMouseArea.cursorShape === Qt.BlankCursor ? Qt.ArrowCursor : Qt.BlankCursor
}
}
}
}
}
MainMenu {
id: menu
anchors.fill: parent
}
Image {
id: kdabLogoBottomRight
width: parent.width/13
smooth: true
antialiasing: true
source: "kdab_logo_white.png"
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.bottomMargin: width/4
anchors.rightMargin: width/4
fillMode: Image.PreserveAspectFit
MouseArea {
anchors.fill: parent
onPressAndHold: menu.idleAnimationRunning = true
}
}
Image {
id: qtLogo
property bool kuesaLogo: true
anchors.verticalCenter: kdabLogoBottomRight.verticalCenter
anchors.right: kdabLogoBottomRight.left
anchors.rightMargin: kdabLogoBottomRight.anchors.rightMargin/1.3
width: parent.width/15* (kuesaLogo ? 2.3 : 1.8)
smooth: true
antialiasing: true
source: kuesaLogo ? "Kuesa-logo-black.png" : "Qt-logo.png"
fillMode: Image.PreserveAspectFit
MouseArea {
anchors.fill: parent
onPressAndHold: qtLogo.kuesaLogo = !qtLogo.kuesaLogo
}
}
}