diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-02-18 14:32:44 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-18 15:49:44 +0000 |
commit | 6e55982168a68c68dbeb55f1a47a209553c687b9 (patch) | |
tree | 7ae5c78815798bb269ba5e3973c6b7ab53031fbb | |
parent | 449b3c30223cbcb675a15c2f73f950d78f49ffff (diff) |
Use qmath functions
Fixes compilation on QNX 6.6.
Change-Id: Ib6215d5bc1f86139154deb025beb38c591f78f76
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/render/frontend/qcylindermesh.cpp | 10 | ||||
-rw-r--r-- | src/render/frontend/qspheremesh.cpp | 10 | ||||
-rw-r--r-- | src/render/frontend/qtorusmesh.cpp | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/render/frontend/qcylindermesh.cpp b/src/render/frontend/qcylindermesh.cpp index 0e0f45436..7c5193f59 100644 --- a/src/render/frontend/qcylindermesh.cpp +++ b/src/render/frontend/qcylindermesh.cpp @@ -45,7 +45,7 @@ #include "qmeshdata.h" #include <Qt3DRenderer/private/qabstractmesh_p.h> -#include <cmath> +#include <qmath.h> QT_BEGIN_NAMESPACE @@ -212,8 +212,8 @@ void createSides(float *&verticesPtr, quint16 *&indicesPtr, for (int slice = 0; slice <= slices; slice++) { const float theta = static_cast<float>(slice) * dTheta; - const float ct = cos(theta); - const float st = sin(theta); + const float ct = qCos(theta); + const float st = qSin(theta); *verticesPtr++ = radius * ct; *verticesPtr++ = y; @@ -264,8 +264,8 @@ void createDisc(float *&verticesPtr, quint16 *&indicesPtr, for (int slice = 0; slice <= slices; slice++) { const float theta = static_cast<float>(slice) * dTheta; - const float ct = cos(theta); - const float st = sin(theta); + const float ct = qCos(theta); + const float st = qSin(theta); *verticesPtr++ = radius * ct; *verticesPtr++ = yPosition; diff --git a/src/render/frontend/qspheremesh.cpp b/src/render/frontend/qspheremesh.cpp index 1624f5a36..a26840bd3 100644 --- a/src/render/frontend/qspheremesh.cpp +++ b/src/render/frontend/qspheremesh.cpp @@ -46,7 +46,7 @@ #include "qmeshdata.h" #include <private/qabstractmesh_p.h> -#include <cmath> +#include <qmath.h> QT_BEGIN_NAMESPACE @@ -191,16 +191,16 @@ QMeshDataPtr createSphereMesh(double radius, int rings, int slices, bool hasTang for ( int lat = 0; lat < rings + 1; ++lat ) { const float phi = M_PI_2 - static_cast<float>( lat ) * dPhi; - const float cosPhi = cosf( phi ); - const float sinPhi = sinf( phi ); + const float cosPhi = qCos( phi ); + const float sinPhi = qSin( phi ); const float v = 1.0f - static_cast<float>( lat ) * dv; // Iterate over longitudes (slices) for ( int lon = 0; lon < slices + 1; ++lon ) { const float theta = static_cast<float>( lon ) * dTheta; - const float cosTheta = cosf( theta ); - const float sinTheta = sinf( theta ); + const float cosTheta = qCos( theta ); + const float sinTheta = qSin( theta ); const float u = static_cast<float>( lon ) * du; *fptr++ = radius * cosTheta * cosPhi; diff --git a/src/render/frontend/qtorusmesh.cpp b/src/render/frontend/qtorusmesh.cpp index b45c0958e..09b4e2a54 100644 --- a/src/render/frontend/qtorusmesh.cpp +++ b/src/render/frontend/qtorusmesh.cpp @@ -45,7 +45,7 @@ #include "qmeshdata.h" #include <Qt3DRenderer/private/qabstractmesh_p.h> -#include <cmath> +#include <qmath.h> QT_BEGIN_NAMESPACE @@ -182,14 +182,14 @@ QMeshDataPtr createTorusMesh(double radius, double minorRadius, for ( int ring = 0; ring <= rings; ring++ ) { float u = ring * ringFactor; - float cu = cos( u ); - float su = sin( u ); + float cu = qCos( u ); + float su = qSin( u ); for ( int side = 0; side < sides; side++ ) { float v = side * sideFactor; - float cv = cos( v ); - float sv = sin( v ); + float cv = qCos( v ); + float sv = qSin( v ); float r = ( radius + minorRadius * cv ); *fptr++ = r * cu; |