From 2e34ef2d053cfa0c152442a758dda6296902c7c8 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 23 Mar 2015 15:48:54 +0100 Subject: Examples: fixed to work with QAbstractTransform as QObject Also fixed QTransform to copy proper transformation matrix to work when loaded in the backend and sent to the frontend. Change-Id: Iec417fd49092b5e3d7971784327ff4bbfb75549b Reviewed-by: Sean Harmer --- examples/qt3d/deferred-renderer-qml/main.qml | 24 ++++----- examples/qt3d/enabled-qml/main.qml | 81 ++++++++++++++-------------- examples/qt3d/loader-qml/main.qml | 20 +++---- examples/qt3d/scene3d/AnimatedEntity.qml | 20 +++---- examples/qt3d/simple-qml/main.qml | 21 ++++---- 5 files changed, 84 insertions(+), 82 deletions(-) (limited to 'examples') diff --git a/examples/qt3d/deferred-renderer-qml/main.qml b/examples/qt3d/deferred-renderer-qml/main.qml index c30c57fd4..d70619baa 100644 --- a/examples/qt3d/deferred-renderer-qml/main.qml +++ b/examples/qt3d/deferred-renderer-qml/main.qml @@ -138,14 +138,14 @@ Entity { property Transform transform : Transform { Translate{ dx: -10; dy: 0; dz : 5 id: sphere1Translate - QQ2.SequentialAnimation { - loops: QQ2.Animation.Infinite - running: false - QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: 6; duration: 2000 } - QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: -10; duration: 2000 } - } } } + QQ2.SequentialAnimation { + loops: QQ2.Animation.Infinite + running: false + QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: 6; duration: 2000 } + QQ2.NumberAnimation {target: sphere1Translate; property: "dx"; to: -10; duration: 2000 } + } property PointLight light : PointLight { color : "green" @@ -201,14 +201,14 @@ Entity { property Transform transform : Transform { Translate{ id: light3Translate; dx: 2; dy: 2; dz : 7 - QQ2.SequentialAnimation { - loops: QQ2.Animation.Infinite - running: true - QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: 6; duration: 1000; easing.type: QQ2.Easing.InOutQuad } - QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: -6; duration: 1000; easing.type: QQ2.Easing.InOutQuint } - } } } + QQ2.SequentialAnimation { + loops: QQ2.Animation.Infinite + running: true + QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: 6; duration: 1000; easing.type: QQ2.Easing.InOutQuad } + QQ2.NumberAnimation {target: light3Translate; property: "dy"; to: -6; duration: 1000; easing.type: QQ2.Easing.InOutQuint } + } components: [ sphereMesh, diff --git a/examples/qt3d/enabled-qml/main.qml b/examples/qt3d/enabled-qml/main.qml index 9342ba6c9..031759556 100644 --- a/examples/qt3d/enabled-qml/main.qml +++ b/examples/qt3d/enabled-qml/main.qml @@ -127,49 +127,50 @@ Entity { Translate { id: translate + } + } - QQ2.SequentialAnimation { - running: true - loops: QQ2.Animation.Infinite - QQ2.NumberAnimation { - target: translate; property: "dx" - from: 0; to: 5; - duration: 550 - easing.type: QQ2.Easing.InOutQuad - } - QQ2.NumberAnimation { - target: translate; property: "dy" - from: 0; to: 5; - duration: 650 - easing.type: QQ2.Easing.InOutQuad - } - QQ2.NumberAnimation { - target: translate; property: "dz" - from: 0; to: 5; - duration: 350 - easing.type: QQ2.Easing.InOutQuad - } - QQ2.NumberAnimation { - target: translate; property: "dx" - from: 5; to: 0; - duration: 550 - easing.type: QQ2.Easing.InOutQuad - } - QQ2.NumberAnimation { - target: translate; property: "dy" - from: 5; to: 0; - duration: 350 - easing.type: QQ2.Easing.InOutQuad - } - QQ2.NumberAnimation { - target: translate; property: "dz" - from: 5; to: 0; - duration: 650 - easing.type: QQ2.Easing.InOutQuad - } - } + QQ2.SequentialAnimation { + running: true + loops: QQ2.Animation.Infinite + QQ2.NumberAnimation { + target: translate; property: "dx" + from: 0; to: 5; + duration: 550 + easing.type: QQ2.Easing.InOutQuad + } + QQ2.NumberAnimation { + target: translate; property: "dy" + from: 0; to: 5; + duration: 650 + easing.type: QQ2.Easing.InOutQuad + } + QQ2.NumberAnimation { + target: translate; property: "dz" + from: 0; to: 5; + duration: 350 + easing.type: QQ2.Easing.InOutQuad + } + QQ2.NumberAnimation { + target: translate; property: "dx" + from: 5; to: 0; + duration: 550 + easing.type: QQ2.Easing.InOutQuad + } + QQ2.NumberAnimation { + target: translate; property: "dy" + from: 5; to: 0; + duration: 350 + easing.type: QQ2.Easing.InOutQuad + } + QQ2.NumberAnimation { + target: translate; property: "dz" + from: 5; to: 0; + duration: 650 + easing.type: QQ2.Easing.InOutQuad } } + components: [sphereMesh, material, layer, transform] } diff --git a/examples/qt3d/loader-qml/main.qml b/examples/qt3d/loader-qml/main.qml index 9857a5eaa..fa3e8ff5a 100644 --- a/examples/qt3d/loader-qml/main.qml +++ b/examples/qt3d/loader-qml/main.qml @@ -118,16 +118,16 @@ Entity { Rotate { id: sphereRotation axis: Qt.vector3d(0, 1, 0) - QQ2.NumberAnimation { - target: sphereRotation - property: "angle" - duration: 10000 - from: 0 - to: 360 - - loops: QQ2.Animation.Infinite - running: true - } } } + QQ2.NumberAnimation { + target: sphereRotation + property: "angle" + duration: 10000 + from: 0 + to: 360 + + loops: QQ2.Animation.Infinite + running: true + } } diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml index 8c44fde0d..72d9787d6 100644 --- a/examples/qt3d/scene3d/AnimatedEntity.qml +++ b/examples/qt3d/scene3d/AnimatedEntity.qml @@ -118,18 +118,18 @@ Entity { Rotate { id: sphereRotation axis: Qt.vector3d(0, 1, 0) - QQ2.NumberAnimation { - target: sphereRotation - property: "angle" - duration: 10000 - from: 0 - to: 360 - - loops: QQ2.Animation.Infinite - running: true - } } } + QQ2.NumberAnimation { + target: sphereRotation + property: "angle" + duration: 10000 + from: 0 + to: 360 + + loops: QQ2.Animation.Infinite + running: true + } Entity { id: sphereEntity diff --git a/examples/qt3d/simple-qml/main.qml b/examples/qt3d/simple-qml/main.qml index 7896766c5..c82bafaa3 100644 --- a/examples/qt3d/simple-qml/main.qml +++ b/examples/qt3d/simple-qml/main.qml @@ -106,19 +106,20 @@ Entity { Rotate { id: sphereRotation axis: Qt.vector3d(0, 1, 0) - QQ2.NumberAnimation { - target: sphereRotation - property: "angle" - duration: 10000 - from: 0 - to: 360 - - loops: QQ2.Animation.Infinite - running: true - } } } + QQ2.NumberAnimation { + target: sphereRotation + property: "angle" + duration: 10000 + from: 0 + to: 360 + + loops: QQ2.Animation.Infinite + running: true + } + Entity { id: sphereEntity components: [ sphereMesh, material, sphereTransform ] -- cgit v1.2.3