From b23e1774329d8091a5368483cd549791a71b435c Mon Sep 17 00:00:00 2001 From: Tomi Korpipaa Date: Mon, 18 Sep 2017 12:05:20 +0300 Subject: Fix planets-qml example for Qt 5.10 Task-number: QTBUG-62321 Change-Id: I1df375c9a6a72049584eee118613bca72958e4f0 Reviewed-by: Sean Harmer --- examples/qt3d/planets-qml/SolarSystem.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/qt3d/planets-qml/SolarSystem.qml') 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 -- cgit v1.2.3