From bbd8edbe640a2dad22caaa0795033935419882c0 Mon Sep 17 00:00:00 2001 From: Tomi Korpipaa <tomi.korpipaa@qt.io> Date: Mon, 3 Feb 2020 08:45:33 +0200 Subject: [PATCH] Convert to QtQuick3D 1.15 APIs --- XaxisCluster/AdasView.qml | 18 ++++++++---------- XaxisCluster/HighPolyVan.qml | 6 ++---- XaxisCluster/LowPolySUV.qml | 6 ++---- XaxisCluster/LowPolySUVGray.qml | 6 ++---- XaxisCluster/MainCar.qml | 8 +++----- XaxisCluster/SuvOther.qml | 8 +++----- XaxisCluster/SuvOwn.qml | 8 +++----- XaxisCluster/Van.qml | 8 +++----- XaxisCluster/XaxisCluster.pro | 2 +- XaxisCluster/main.cpp | 4 ++-- XaxisCluster/main.qml | 8 ++++---- 11 files changed, 33 insertions(+), 49 deletions(-) diff --git a/XaxisCluster/AdasView.qml b/XaxisCluster/AdasView.qml index d963088..953b10d 100644 --- a/XaxisCluster/AdasView.qml +++ b/XaxisCluster/AdasView.qml @@ -1,5 +1,5 @@ -import QtQuick3D 1.12 -import QtQuick3D.Materials 1.12 +import QtQuick3D 1.15 +import QtQuick3D.Materials 1.15 import QtQuick 2.12 import QtQuick.Timeline 1.0 @@ -38,10 +38,10 @@ Item { PerspectiveCamera { id: camera_u623 position.y: cameraYPosition - position.z: -800 + position.z: 800 position.x: ownCar.xPos - rotation.x: cameraRotation - rotation.z: cameraZRotation + eulerRotation.x: cameraRotation + eulerRotation.z: cameraZRotation clipNear: 1 clipFar: 1200 fieldOfView: 45 @@ -54,12 +54,10 @@ Item { id: sphere_u23107 position.y: -235 position.z: 0 - rotation.x: -90 + eulerRotation.x: -90 scale.x: 1850 scale.y: 1950 scale.z: 950 - rotationOrder: Node.XYZr - orientation: Node.RightHanded source: "qrc:/models/ADASglobe/meshes/Sphere.mesh" CustomMaterial { @@ -127,7 +125,7 @@ Item { Node { position.y: 770 - position.z: -600 + position.z: 600 MainCar { id: ownCar @@ -206,7 +204,7 @@ Item { scale.y: 3 scale.x: 12 position.y: 800 - position.z: 375 + position.z: -375 source: "#Rectangle" materials: [ DefaultMaterial { diff --git a/XaxisCluster/HighPolyVan.qml b/XaxisCluster/HighPolyVan.qml index 41b40d8..2f5824b 100644 --- a/XaxisCluster/HighPolyVan.qml +++ b/XaxisCluster/HighPolyVan.qml @@ -1,12 +1,10 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { property alias matOpacity: defaultMaterial_material.opacity id: body_24 - rotation.y: 180 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.y: 180 source: "meshes/HighPolyVan.mesh" DefaultMaterial { diff --git a/XaxisCluster/LowPolySUV.qml b/XaxisCluster/LowPolySUV.qml index 3d9896b..8a52a1d 100644 --- a/XaxisCluster/LowPolySUV.qml +++ b/XaxisCluster/LowPolySUV.qml @@ -1,11 +1,9 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { id: lowpolyCar - rotation.x: -90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 source: "qrc:/meshes/LowPolySUV.mesh" DefaultMaterial { diff --git a/XaxisCluster/LowPolySUVGray.qml b/XaxisCluster/LowPolySUVGray.qml index 87aa68f..038c8cf 100644 --- a/XaxisCluster/LowPolySUVGray.qml +++ b/XaxisCluster/LowPolySUVGray.qml @@ -1,12 +1,10 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { property alias matOpacity: phong1SG_material.opacity id: lowpolyCar - rotation.x: -90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 source: "qrc:/meshes/LowPolySUV.mesh" DefaultMaterial { diff --git a/XaxisCluster/MainCar.qml b/XaxisCluster/MainCar.qml index c0de2db..77fea69 100644 --- a/XaxisCluster/MainCar.qml +++ b/XaxisCluster/MainCar.qml @@ -1,11 +1,9 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { - rotation.x: -90 - rotation.y: 90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 + eulerRotation.y: 90 source: "meshes/MainCar.mesh" DefaultMaterial { diff --git a/XaxisCluster/SuvOther.qml b/XaxisCluster/SuvOther.qml index 97786c7..1b747f2 100644 --- a/XaxisCluster/SuvOther.qml +++ b/XaxisCluster/SuvOther.qml @@ -1,12 +1,10 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { property alias matOpacity: suvOtherMaterial.opacity - rotation.x: -90 - rotation.y: 90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 + eulerRotation.y: 90 source: "meshes/SuvOther.mesh" DefaultMaterial { diff --git a/XaxisCluster/SuvOwn.qml b/XaxisCluster/SuvOwn.qml index 65f6f63..f881131 100644 --- a/XaxisCluster/SuvOwn.qml +++ b/XaxisCluster/SuvOwn.qml @@ -1,11 +1,9 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { - rotation.x: -90 - rotation.y: 90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 + eulerRotation.y: 90 source: "meshes/SuvOwn.mesh" DefaultMaterial { diff --git a/XaxisCluster/Van.qml b/XaxisCluster/Van.qml index a4dc506..a1dd519 100644 --- a/XaxisCluster/Van.qml +++ b/XaxisCluster/Van.qml @@ -1,12 +1,10 @@ -import QtQuick3D 1.12 +import QtQuick3D 1.15 import QtQuick 2.12 Model { property alias matOpacity: vanMaterial.opacity - rotation.x: -90 - rotation.y: 90 - rotationOrder: Node.XYZr - orientation: Node.RightHanded + eulerRotation.x: -90 + eulerRotation.y: 90 source: "meshes/Van.mesh" DefaultMaterial { diff --git a/XaxisCluster/XaxisCluster.pro b/XaxisCluster/XaxisCluster.pro index 99af6df..c2984e3 100644 --- a/XaxisCluster/XaxisCluster.pro +++ b/XaxisCluster/XaxisCluster.pro @@ -1,4 +1,4 @@ -QT += quick quick3d-private +QT += quick quick3d CONFIG += c++11 # The following define makes your compiler emit warnings if you use diff --git a/XaxisCluster/main.cpp b/XaxisCluster/main.cpp index 7195692..f52a033 100644 --- a/XaxisCluster/main.cpp +++ b/XaxisCluster/main.cpp @@ -1,6 +1,6 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> -#include <QtQuick3D/private/qquick3dviewport_p.h> +#include <QtQuick3D/qquick3d.h> int main(int argc, char *argv[]) { @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); - QSurfaceFormat::setDefaultFormat(QQuick3DViewport::idealSurfaceFormat()); + QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat()); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/XaxisCluster/main.qml b/XaxisCluster/main.qml index 7614455..2177591 100644 --- a/XaxisCluster/main.qml +++ b/XaxisCluster/main.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Window 2.12 -import QtQuick3D.Helpers 1.12 +import QtQuick3D.Helpers 1.15 // // Note: Font sizes are adjusted for target HW (R-Car D3 with 1920x720 display). They will look @@ -394,7 +394,7 @@ Window { property: "cameraRotation" duration: 3000 from: 0.0 - to: 35 + to: -35 easing.type: Easing.InOutCubic; } // All done @@ -459,7 +459,7 @@ Window { target: adasview property: "cameraRotation" duration: 5000 - from: 35 + from: -35 to: 0 easing.type: Easing.InOutCubic; } @@ -469,7 +469,7 @@ Window { property: "cameraRotation" duration: 5000 from: 0 - to: 35 + to: -35 easing.type: Easing.InOutCubic; } } -- GitLab