diff options
author | Petr Nejedly <pnejedly@blackberry.com> | 2013-07-24 08:13:18 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-26 14:06:15 +0200 |
commit | 88054e44722c9fd5aab90928ee8052ee054053a3 (patch) | |
tree | af967a4fc80b9772ddc2f2b06b24f6f754c948aa /src/particles/qquicktargetdirection.cpp | |
parent | 07860794da5863610f38295c9d517fc457c5de95 (diff) |
std:: fixes to make qtdeclarative closer to compilable with QNX NDK.
Math functions come in std:: when #included through <cmath>
Change-Id: I62550e5c23cb6f4464f2c2f5c4188a91b3512d1a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/particles/qquicktargetdirection.cpp')
-rw-r--r-- | src/particles/qquicktargetdirection.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/particles/qquicktargetdirection.cpp b/src/particles/qquicktargetdirection.cpp index 8a59bcd707..6c44ecccab 100644 --- a/src/particles/qquicktargetdirection.cpp +++ b/src/particles/qquicktargetdirection.cpp @@ -121,12 +121,12 @@ const QPointF QQuickTargetDirection::sample(const QPointF &from) } targetX += 0 - from.x() - m_targetVariation + rand()/(float)RAND_MAX * m_targetVariation*2; targetY += 0 - from.y() - m_targetVariation + rand()/(float)RAND_MAX * m_targetVariation*2; - qreal theta = atan2(targetY, targetX); + qreal theta = std::atan2(targetY, targetX); qreal mag = m_magnitude + rand()/(float)RAND_MAX * m_magnitudeVariation * 2 - m_magnitudeVariation; if (m_proportionalMagnitude) - mag *= sqrt(targetX * targetX + targetY * targetY); - ret.setX(mag * cos(theta)); - ret.setY(mag * sin(theta)); + mag *= std::sqrt(targetX * targetX + targetY * targetY); + ret.setX(mag * std::cos(theta)); + ret.setY(mag * std::sin(theta)); return ret; } |