summaryrefslogtreecommitdiffstats
path: root/examples/qt3d
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2017-09-18 12:05:20 +0300
committerTomi Korpipää <tomi.korpipaa@qt.io>2017-09-19 03:24:07 +0000
commitb23e1774329d8091a5368483cd549791a71b435c (patch)
tree08bbfd4633415bf0d149b3947fb5971a45509d2e /examples/qt3d
parent3f03499bf8a7cf3c3f8d19a020179c1205980bde (diff)
Fix planets-qml example for Qt 5.10
Task-number: QTBUG-62321 Change-Id: I1df375c9a6a72049584eee118613bca72958e4f0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d')
-rw-r--r--examples/qt3d/planets-qml/PlanetMaterial.qml6
-rw-r--r--examples/qt3d/planets-qml/SolarSystem.qml5
2 files changed, 8 insertions, 3 deletions
diff --git a/examples/qt3d/planets-qml/PlanetMaterial.qml b/examples/qt3d/planets-qml/PlanetMaterial.qml
index 4d50aee8d..309acf24d 100644
--- a/examples/qt3d/planets-qml/PlanetMaterial.qml
+++ b/examples/qt3d/planets-qml/PlanetMaterial.qml
@@ -115,7 +115,8 @@ Material {
TextureImage {
id: specularTextureImage
// Get rid of runtime warnings. It's safe, as the texture just isn't used
- source: specularMap !== "" ? specularMap : "qrc:/images/uranusmap.jpg"
+ source: specularMap !== "" ? specularMap
+ : "qrc:/images/solarsystemscope/uranusmap.jpg"
}
}
},
@@ -133,7 +134,8 @@ Material {
TextureImage {
id: normalTextureImage
// Get rid of runtime warnings. It's safe, as the texture just isn't used
- source: normalMap !== "" ? normalMap : "qrc:/images/uranusmap.jpg"
+ source: normalMap !== "" ? normalMap
+ : "qrc:/images/solarsystemscope/uranusmap.jpg"
}
}
},
diff --git a/examples/qt3d/planets-qml/SolarSystem.qml b/examples/qt3d/planets-qml/SolarSystem.qml
index 3a717e62a..8c0cfccd4 100644
--- a/examples/qt3d/planets-qml/SolarSystem.qml
+++ b/examples/qt3d/planets-qml/SolarSystem.qml
@@ -395,7 +395,10 @@ Entity {
var v = Math.atan2(yv, xv)
// Calculate the distance (radius)
- var r = Math.hypot(xv, yv)
+ // TODO: Math.hypot() is ES6 and QML JS is only ES5 currently. A patch to QtQml is
+ // required to get Math.hypot() to work.
+ //var r = Math.hypot(xv, yv)
+ var r = Math.sqrt(Math.pow(xv, 2) + Math.pow(yv, 2))
// From http://www.davidcolarusso.com/astro/
// Modified to compensate for the right handed coordinate system of OpenGL