aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickcustomaffector.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-06-25 12:01:46 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-29 02:21:36 +0200
commit5df94d89033e7bbb3f41840a4c07a628ed66b4d5 (patch)
treee42bcd16d8f5f3a192c48794b610ffeb05b9dc02 /src/particles/qquickcustomaffector.cpp
parent2241d6fa2d39fe890ba0d17ff58b5e0615c1cd7b (diff)
Rename speed -> velocity in the particle system
Matches the convention set in the QtQuick module, for example by ListView and Flickable. Change-Id: I8df57ed1ced8128723d790c30c00cc1b2062787d Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/particles/qquickcustomaffector.cpp')
-rw-r--r--src/particles/qquickcustomaffector.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/particles/qquickcustomaffector.cpp b/src/particles/qquickcustomaffector.cpp
index 819dd128fa..219da82ad5 100644
--- a/src/particles/qquickcustomaffector.cpp
+++ b/src/particles/qquickcustomaffector.cpp
@@ -71,9 +71,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty StochasticDirection QtQuick.Particles2::Affector::speed
+ \qmlproperty StochasticDirection QtQuick.Particles2::Affector::velocity
- Affected particles will have their speed set to this direction.
+ Affected particles will have their velocity set to this direction.
*/
@@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlproperty bool QtQuick.Particles2::Affector::relative
- Whether the affected particles have their existing position/speed/acceleration added
+ Whether the affected particles have their existing position/velocity/acceleration added
to the new one.
Default is true.
@@ -95,7 +95,7 @@ QT_BEGIN_NAMESPACE
QQuickCustomAffector::QQuickCustomAffector(QQuickItem *parent) :
QQuickParticleAffector(parent)
, m_position(&m_nullVector)
- , m_speed(&m_nullVector)
+ , m_velocity(&m_nullVector)
, m_acceleration(&m_nullVector)
, m_relative(true)
{
@@ -110,7 +110,7 @@ void QQuickCustomAffector::affectSystem(qreal dt)
{
//Acts a bit differently, just emits affected for everyone it might affect, when the only thing is connecting to affected(x,y)
bool justAffected = (m_acceleration == &m_nullVector
- && m_speed == &m_nullVector
+ && m_velocity == &m_nullVector
&& m_position == &m_nullVector
&& isAffectedConnected());
if (!isAffectConnected() && !justAffected) {
@@ -193,8 +193,8 @@ bool QQuickCustomAffector::affectParticle(QQuickParticleData *d, qreal dt)
}
}
- if (m_speed != &m_nullVector){
- QPointF pos = m_speed->sample(curPos);
+ if (m_velocity != &m_nullVector){
+ QPointF pos = m_velocity->sample(curPos);
QPointF curVel = QPointF(d->curVX(), d->curVY());
if (m_relative) {
pos *= dt;