qtdoc/examples/demos/car-configurator/content/DoorButton.qml

111 lines
2.5 KiB
QML
Raw Permalink Normal View History

Port the latest updates from design studio demo project <CarRendering> The update contains the following changes: * better glow for lights * videoWall reflections fixed * Updates to the UI, buttons and logo position * Fixes on Glitches * FaceLift * New Wheels and BackLights * VideoWall rePositioning * New Car PaintWork + videoWall * BackLight Reflection removal * Desert polishes * Studio Improvements * Smooth Car paint change transitions * ColorButton Start fix * Door openings * Added Trunk and Hood openers * Visibilty of door openers based on camera Angle * Door openers Smooth transitions * Removed Lights from Studio * Reflection Probe ReDone in VideoScene * Door button is smaller and has background blur * Interior colors and Lights * Interior material tweaks * More realistic headlights * New Car paint material * Tiny update to margins for UI * Better carPaint and Window materials * Headlight glass material * New Wheel textures * Front headlight geometry * Added easing to door animations * Door button fix * New Demomode Blending * Headlight decal and material update * Desert Visual updates * Desert scene Custom shadows * Fix new shadows * More Transparent fake shadows * Added a new svg icon for the door and updated the button for it * Tiny update to pebbles and enabled shadow plane inside car * Blended Shadow plane * Added Correct button font * New Default Camera position * Hood shadow animation fixed * Working car shadows Task-number: QTBUG-126959 Pick-to: 6.8 Change-Id: I596f6befeb881c73354306f51feca4faa7c88c6e Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-07-02 15:22:52 +00:00
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import "doorIcon"
import QtQuick.Controls
import QtQuick.Studio.DesignEffects
Rectangle {
id: doorButton
width: 48
height: 48
opacity: 0.7
color: "#00000000"
radius: 8
scale: 1
property bool isChecked: checkBox.checked
property bool isRendered: true
property vector3d trackedWorldPosition: cube.scenePosition
function updateState() {
var scenePosition = sceneCamera2.mapToViewport(trackedWorldPosition)
doorButton.x = scenePosition.x * root.width
doorButton.y = scenePosition.y * root.height
}
Component.onCompleted: updateState()
Connections {
target: sceneCamera2
function onSceneTransformChanged() { doorButton.updateState() }
}
CheckBox {
id: checkBox
opacity: 0
text: qsTr(" ")
anchors.fill: parent
}
Connections {
target: root
function onWidthChanged() { doorButton.updateState() }
function onHeightChanged() { doorButton.updateState() }
}
Door_button {
id: door_button
}
FrameAnimation {
running: true
onTriggered: updateState()
}
Port the latest updates from design studio demo project <CarRendering> The update contains the following changes: * better glow for lights * videoWall reflections fixed * Updates to the UI, buttons and logo position * Fixes on Glitches * FaceLift * New Wheels and BackLights * VideoWall rePositioning * New Car PaintWork + videoWall * BackLight Reflection removal * Desert polishes * Studio Improvements * Smooth Car paint change transitions * ColorButton Start fix * Door openings * Added Trunk and Hood openers * Visibilty of door openers based on camera Angle * Door openers Smooth transitions * Removed Lights from Studio * Reflection Probe ReDone in VideoScene * Door button is smaller and has background blur * Interior colors and Lights * Interior material tweaks * More realistic headlights * New Car paint material * Tiny update to margins for UI * Better carPaint and Window materials * Headlight glass material * New Wheel textures * Front headlight geometry * Added easing to door animations * Door button fix * New Demomode Blending * Headlight decal and material update * Desert Visual updates * Desert scene Custom shadows * Fix new shadows * More Transparent fake shadows * Added a new svg icon for the door and updated the button for it * Tiny update to pebbles and enabled shadow plane inside car * Blended Shadow plane * Added Correct button font * New Default Camera position * Hood shadow animation fixed * Working car shadows Task-number: QTBUG-126959 Pick-to: 6.8 Change-Id: I596f6befeb881c73354306f51feca4faa7c88c6e Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-07-02 15:22:52 +00:00
DesignEffect {
backgroundLayer: view3D
backgroundBlurRadius: 10
backgroundBlurVisible: true
}
states: [
State {
name: "rendered"
when: isRendered
},
State {
name: "NotRendered"
when: !isRendered
PropertyChanges {
target: doorButton
opacity: 0.223
scale: 0
}
}
]
transitions: [
Transition {
id: transition
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 567
}
PropertyAnimation {
target: doorButton
property: "opacity"
duration: 431
}
}
SequentialAnimation {
PauseAnimation {
duration: 50
}
PropertyAnimation {
target: doorButton
property: "scale"
duration: 1032
}
}
}
to: "*"
from: "*"
}
]
}