aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
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
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')
-rw-r--r--src/particles/qquickcustomaffector.cpp14
-rw-r--r--src/particles/qquickcustomaffector_p.h22
-rw-r--r--src/particles/qquickcustomparticle.cpp8
-rw-r--r--src/particles/qquickfriction.cpp2
-rw-r--r--src/particles/qquickimageparticle.cpp60
-rw-r--r--src/particles/qquickimageparticle_p.h24
-rw-r--r--src/particles/qquickparticleemitter.cpp34
-rw-r--r--src/particles/qquickparticleemitter_p.h30
-rw-r--r--src/particles/qquickparticlesystem.cpp4
-rw-r--r--src/particles/qquickparticlesystem_p.h2
-rw-r--r--src/particles/qquicktrailemitter.cpp18
-rw-r--r--src/particles/qquickv8particledata.cpp8
-rw-r--r--src/particles/qquickwander.cpp2
13 files changed, 114 insertions, 114 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;
diff --git a/src/particles/qquickcustomaffector_p.h b/src/particles/qquickcustomaffector_p.h
index 1266830f94..74121903be 100644
--- a/src/particles/qquickcustomaffector_p.h
+++ b/src/particles/qquickcustomaffector_p.h
@@ -57,7 +57,7 @@ class QQuickCustomAffector : public QQuickParticleAffector
Q_OBJECT
Q_PROPERTY(bool relative READ relative WRITE setRelative NOTIFY relativeChanged)
Q_PROPERTY(QQuickDirection *position READ position WRITE setPosition NOTIFY positionChanged RESET positionReset)
- Q_PROPERTY(QQuickDirection *speed READ speed WRITE setSpeed NOTIFY speedChanged RESET speedReset)
+ Q_PROPERTY(QQuickDirection *velocity READ velocity WRITE setVelocity NOTIFY velocityChanged RESET velocityReset)
Q_PROPERTY(QQuickDirection *acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged RESET accelerationReset)
public:
@@ -69,9 +69,9 @@ public:
return m_position;
}
- QQuickDirection * speed() const
+ QQuickDirection * velocity() const
{
- return m_speed;
+ return m_velocity;
}
QQuickDirection * acceleration() const
@@ -84,9 +84,9 @@ public:
m_position = &m_nullVector;
}
- void speedReset()
+ void velocityReset()
{
- m_speed = &m_nullVector;
+ m_velocity = &m_nullVector;
}
void accelerationReset()
@@ -105,7 +105,7 @@ signals:
void positionChanged(QQuickDirection * arg);
- void speedChanged(QQuickDirection * arg);
+ void velocityChanged(QQuickDirection * arg);
void accelerationChanged(QQuickDirection * arg);
@@ -120,11 +120,11 @@ public slots:
}
}
- void setSpeed(QQuickDirection * arg)
+ void setVelocity(QQuickDirection * arg)
{
- if (m_speed != arg) {
- m_speed = arg;
- emit speedChanged(arg);
+ if (m_velocity != arg) {
+ m_velocity = arg;
+ emit velocityChanged(arg);
}
}
@@ -150,7 +150,7 @@ protected:
private:
void affectProperties(const QList<QQuickParticleData*> particles, qreal dt);
QQuickDirection * m_position;
- QQuickDirection * m_speed;
+ QQuickDirection * m_velocity;
QQuickDirection * m_acceleration;
QQuickDirection m_nullVector;
diff --git a/src/particles/qquickcustomparticle.cpp b/src/particles/qquickcustomparticle.cpp
index eeb830cc87..777237a32b 100644
--- a/src/particles/qquickcustomparticle.cpp
+++ b/src/particles/qquickcustomparticle.cpp
@@ -50,7 +50,7 @@ static const char qt_particles_template_vertex_code[] =
"attribute highp vec2 qt_ParticlePos;\n"
"attribute highp vec2 qt_ParticleTex;\n"
"attribute highp vec4 qt_ParticleData; // x = time, y = lifeSpan, z = size, w = endSize\n"
- "attribute highp vec4 qt_ParticleVec; // x,y = constant speed, z,w = acceleration\n"
+ "attribute highp vec4 qt_ParticleVec; // x,y = constant velocity, z,w = acceleration\n"
"attribute highp float qt_ParticleR;\n"
"uniform highp mat4 qt_Matrix;\n"
"uniform highp float qt_Timestamp;\n"
@@ -65,7 +65,7 @@ static const char qt_particles_template_vertex_code[] =
" currentSize = 0.;\n"
" highp vec2 pos = qt_ParticlePos\n"
" - currentSize / 2. + currentSize * qt_ParticleTex // adjust size\n"
- " + qt_ParticleVec.xy * t * qt_ParticleData.y // apply speed vector..\n"
+ " + qt_ParticleVec.xy * t * qt_ParticleData.y // apply velocity vector..\n"
" + 0.5 * qt_ParticleVec.zw * pow(t * qt_ParticleData.y, 2.);\n"
" gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);\n"
"}";
@@ -194,7 +194,7 @@ void QQuickCustomParticle::setFragmentShader(const QByteArray &code)
attribute highp vec2 qt_ParticlePos;
attribute highp vec2 qt_ParticleTex;
attribute highp vec4 qt_ParticleData; // x = time, y = lifeSpan, z = size, w = endSize
- attribute highp vec4 qt_ParticleVec; // x,y = constant speed, z,w = acceleration
+ attribute highp vec4 qt_ParticleVec; // x,y = constant velocity, z,w = acceleration
attribute highp float qt_ParticleR;
uniform highp mat4 qt_Matrix;
uniform highp float qt_Timestamp;
@@ -209,7 +209,7 @@ void QQuickCustomParticle::setFragmentShader(const QByteArray &code)
currentSize = 0.;
highp vec2 pos = qt_ParticlePos
- currentSize / 2. + currentSize * qt_ParticleTex // adjust size
- + qt_ParticleVec.xy * t * qt_ParticleData.y // apply speed vector..
+ + qt_ParticleVec.xy * t * qt_ParticleData.y // apply velocity vector..
+ 0.5 * qt_ParticleVec.zw * pow(t * qt_ParticleData.y, 2.);
gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);
}
diff --git a/src/particles/qquickfriction.cpp b/src/particles/qquickfriction.cpp
index ca12cbeec8..6a54ea7cc7 100644
--- a/src/particles/qquickfriction.cpp
+++ b/src/particles/qquickfriction.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Particles 2
\ingroup qtquick-particles
\inherits Affector
- \brief For applying friction proportional to the particle's current speed
+ \brief For applying friction proportional to the particle's current velocity
*/
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index 06e5c75ed5..5803c4b703 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -74,14 +74,14 @@ static const char vertexShaderCode[] =
"attribute highp vec2 vPos;\n"
"#endif\n"
"attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize\n"
- "attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration\n"
+ "attribute highp vec4 vVec; // x,y = constant velocity, z,w = acceleration\n"
"uniform highp float entry;\n"
"#if defined(COLOR)\n"
"attribute highp vec4 vColor;\n"
"#endif\n"
"#if defined(DEFORM)\n"
"attribute highp vec4 vDeformVec; //x,y x unit vector; z,w = y unit vector\n"
- "attribute highp vec3 vRotation; //x = radians of rotation, y=rotation speed, z= bool autoRotate\n"
+ "attribute highp vec3 vRotation; //x = radians of rotation, y=rotation velocity, z= bool autoRotate\n"
"#endif\n"
"#if defined(SPRITE)\n"
"attribute highp vec3 vAnimData;// w,h(premultiplied of anim), interpolation progress\n"
@@ -177,11 +177,11 @@ static const char vertexShaderCode[] =
" pos = vPosTex.xy\n"
" + rotatedDeform.xy\n"
" + rotatedDeform.zw\n"
- " + vVec.xy * t * vData.y // apply speed\n"
+ " + vVec.xy * t * vData.y // apply velocity\n"
" + 0.5 * vVec.zw * pow(t * vData.y, 2.); // apply acceleration\n"
"#else\n"
" pos = vPos\n"
- " + vVec.xy * t * vData.y // apply speed vector..\n"
+ " + vVec.xy * t * vData.y // apply velocity vector..\n"
" + 0.5 * vVec.zw * pow(t * vData.y, 2.);\n"
" gl_PointSize = currentSize;\n"
"#endif\n"
@@ -731,14 +731,14 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
*/
/*!
- \qmlproperty real QtQuick.Particles2::ImageParticle::rotationSpeed
+ \qmlproperty real QtQuick.Particles2::ImageParticle::rotationVelocity
- If set particles will rotate at this speed in degrees/second.
+ If set particles will rotate at this velocity in degrees/second.
*/
/*!
- \qmlproperty real QtQuick.Particles2::ImageParticle::rotationSpeedVariation
+ \qmlproperty real QtQuick.Particles2::ImageParticle::rotationVelocityVariation
- If set the rotationSpeed of individual particles will vary by up to this much
+ If set the rotationVelocity of individual particles will vary by up to this much
between particles.
*/
@@ -812,8 +812,8 @@ QQuickImageParticle::QQuickImageParticle(QQuickItem* parent)
, m_blueVariation(0.0)
, m_rotation(0)
, m_rotationVariation(0)
- , m_rotationSpeed(0)
- , m_rotationSpeedVariation(0)
+ , m_rotationVelocity(0)
+ , m_rotationVelocityVariation(0)
, m_autoRotation(false)
, m_xVector(0)
, m_yVector(0)
@@ -1025,22 +1025,22 @@ void QQuickImageParticle::setRotationVariation(qreal arg)
reset();
}
-void QQuickImageParticle::setRotationSpeed(qreal arg)
+void QQuickImageParticle::setRotationVelocity(qreal arg)
{
- if (m_rotationSpeed != arg) {
- m_rotationSpeed = arg;
- emit rotationSpeedChanged(arg);
+ if (m_rotationVelocity != arg) {
+ m_rotationVelocity = arg;
+ emit rotationVelocityChanged(arg);
}
m_explicitRotation = true;
if (perfLevel < Deformable)
reset();
}
-void QQuickImageParticle::setRotationSpeedVariation(qreal arg)
+void QQuickImageParticle::setRotationVelocityVariation(qreal arg)
{
- if (m_rotationSpeedVariation != arg) {
- m_rotationSpeedVariation = arg;
- emit rotationSpeedVariationChanged(arg);
+ if (m_rotationVelocityVariation != arg) {
+ m_rotationVelocityVariation = arg;
+ emit rotationVelocityVariationChanged(arg);
}
m_explicitRotation = true;
if (perfLevel < Deformable)
@@ -1133,8 +1133,8 @@ void QQuickImageParticle::resetRotation()
d->rotationOwner = 0;
m_rotation = 0;
m_rotationVariation = 0;
- m_rotationSpeed = 0;
- m_rotationSpeedVariation = 0;
+ m_rotationVelocity = 0;
+ m_rotationVelocityVariation = 0;
m_autoRotation = false;
}
@@ -1324,7 +1324,7 @@ void QQuickImageParticle::finishBuildParticleNodes()
} else if (m_colorTable || m_sizeTable || m_opacityTable) {
perfLevel = Tabled;
} else if (m_autoRotation || m_rotation || m_rotationVariation
- || m_rotationSpeed || m_rotationSpeedVariation
+ || m_rotationVelocity || m_rotationVelocityVariation
|| m_xVector || m_yVector) {
perfLevel = Deformable;
} else if (m_alphaVariation || m_alpha != 1.0 || m_color.isValid() || m_color_variation
@@ -1713,7 +1713,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx)
}
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;
switch (perfLevel){//Fall-through is intended on all of them
case Sprites:
@@ -1780,16 +1780,16 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx)
datum->rotationOwner = this;
rotation =
(m_rotation + (m_rotationVariation - 2*((qreal)rand()/RAND_MAX)*m_rotationVariation) ) * CONV;
- rotationSpeed =
- (m_rotationSpeed + (m_rotationSpeedVariation - 2*((qreal)rand()/RAND_MAX)*m_rotationSpeedVariation) ) * CONV;
+ rotationVelocity =
+ (m_rotationVelocity + (m_rotationVelocityVariation - 2*((qreal)rand()/RAND_MAX)*m_rotationVelocityVariation) ) * CONV;
autoRotate = m_autoRotation?1.0:0.0;
if (datum->rotationOwner == this) {
datum->rotation = rotation;
- datum->rotationSpeed = rotationSpeed;
+ datum->rotationVelocity = rotationVelocity;
datum->autoRotate = autoRotate;
} else {
getShadowDatum(datum)->rotation = rotation;
- getShadowDatum(datum)->rotationSpeed = rotationSpeed;
+ getShadowDatum(datum)->rotationVelocity = rotationVelocity;
getShadowDatum(datum)->autoRotate = autoRotate;
}
}
@@ -1855,11 +1855,11 @@ void QQuickImageParticle::commit(int gIdx, int pIdx)
if (m_explicitRotation && datum->rotationOwner != this) {
QQuickParticleData* shadow = getShadowDatum(datum);
spriteVertices[i].rotation = shadow->rotation;
- spriteVertices[i].rotationSpeed = shadow->rotationSpeed;
+ spriteVertices[i].rotationVelocity = shadow->rotationVelocity;
spriteVertices[i].autoRotate = shadow->autoRotate;
} else {
spriteVertices[i].rotation = datum->rotation;
- spriteVertices[i].rotationSpeed = datum->rotationSpeed;
+ spriteVertices[i].rotationVelocity = datum->rotationVelocity;
spriteVertices[i].autoRotate = datum->autoRotate;
}
//Sprite-related vertices updated per-frame in spritesUpdate(), not on demand
@@ -1906,11 +1906,11 @@ void QQuickImageParticle::commit(int gIdx, int pIdx)
if (m_explicitRotation && datum->rotationOwner != this) {
QQuickParticleData* shadow = getShadowDatum(datum);
deformableVertices[i].rotation = shadow->rotation;
- deformableVertices[i].rotationSpeed = shadow->rotationSpeed;
+ deformableVertices[i].rotationVelocity = shadow->rotationVelocity;
deformableVertices[i].autoRotate = shadow->autoRotate;
} else {
deformableVertices[i].rotation = datum->rotation;
- deformableVertices[i].rotationSpeed = datum->rotationSpeed;
+ deformableVertices[i].rotationVelocity = datum->rotationVelocity;
deformableVertices[i].autoRotate = datum->autoRotate;
}
if (m_explicitColor && datum->colorOwner != this) {
diff --git a/src/particles/qquickimageparticle_p.h b/src/particles/qquickimageparticle_p.h
index 4db2c9801a..4a8fc5fdbf 100644
--- a/src/particles/qquickimageparticle_p.h
+++ b/src/particles/qquickimageparticle_p.h
@@ -104,7 +104,7 @@ struct DeformableVertex {
float yx;
float yy;
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;//Assumed that GPUs prefer floats to bools
};
@@ -127,7 +127,7 @@ struct SpriteVertex {
float yx;
float yy;
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;//Assumed that GPUs prefer floats to bools
float animW;
float animH;
@@ -172,8 +172,8 @@ class QQuickImageParticle : public QQuickParticlePainter
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged RESET resetRotation)
Q_PROPERTY(qreal rotationVariation READ rotationVariation WRITE setRotationVariation NOTIFY rotationVariationChanged RESET resetRotation)
- Q_PROPERTY(qreal rotationSpeed READ rotationSpeed WRITE setRotationSpeed NOTIFY rotationSpeedChanged RESET resetRotation)
- Q_PROPERTY(qreal rotationSpeedVariation READ rotationSpeedVariation WRITE setRotationSpeedVariation NOTIFY rotationSpeedVariationChanged RESET resetRotation)
+ Q_PROPERTY(qreal rotationVelocity READ rotationVelocity WRITE setRotationVelocity NOTIFY rotationVelocityChanged RESET resetRotation)
+ Q_PROPERTY(qreal rotationVelocityVariation READ rotationVelocityVariation WRITE setRotationVelocityVariation NOTIFY rotationVelocityVariationChanged RESET resetRotation)
//If true, then will face the direction of motion. Stacks with rotation, e.g. setting rotation
//to 180 will lead to facing away from the direction of motion
Q_PROPERTY(bool autoRotation READ autoRotation WRITE setAutoRotation NOTIFY autoRotationChanged RESET resetRotation)
@@ -243,9 +243,9 @@ public:
qreal rotationVariation() const { return m_rotationVariation; }
- qreal rotationSpeed() const { return m_rotationSpeed; }
+ qreal rotationVelocity() const { return m_rotationVelocity; }
- qreal rotationSpeedVariation() const { return m_rotationSpeedVariation; }
+ qreal rotationVelocityVariation() const { return m_rotationVelocityVariation; }
bool autoRotation() const { return m_autoRotation; }
@@ -289,9 +289,9 @@ signals:
void rotationVariationChanged(qreal arg);
- void rotationSpeedChanged(qreal arg);
+ void rotationVelocityChanged(qreal arg);
- void rotationSpeedVariationChanged(qreal arg);
+ void rotationVelocityVariationChanged(qreal arg);
void autoRotationChanged(bool arg);
@@ -323,9 +323,9 @@ public slots:
void setRotationVariation(qreal arg);
- void setRotationSpeed(qreal arg);
+ void setRotationVelocity(qreal arg);
- void setRotationSpeedVariation(qreal arg);
+ void setRotationVelocityVariation(qreal arg);
void setAutoRotation(bool arg);
@@ -388,8 +388,8 @@ private:
qreal m_blueVariation;
qreal m_rotation;
qreal m_rotationVariation;
- qreal m_rotationSpeed;
- qreal m_rotationSpeedVariation;
+ qreal m_rotationVelocity;
+ qreal m_rotationVelocityVariation;
bool m_autoRotation;
QQuickDirection* m_xVector;
QQuickDirection* m_yVector;
diff --git a/src/particles/qquickparticleemitter.cpp b/src/particles/qquickparticleemitter.cpp
index 7db1707d74..72aa0a6909 100644
--- a/src/particles/qquickparticleemitter.cpp
+++ b/src/particles/qquickparticleemitter.cpp
@@ -167,9 +167,9 @@ QT_BEGIN_NAMESPACE
Default value is 0.
*/
/*!
- \qmlproperty StochasticDirection QtQuick.Particles2::Emitter::speed
+ \qmlproperty StochasticDirection QtQuick.Particles2::Emitter::velocity
- The starting speed of the particles emitted.
+ The starting velocity of the particles emitted.
*/
/*!
\qmlproperty StochasticDirection QtQuick.Particles2::Emitter::acceleration
@@ -177,12 +177,12 @@ QT_BEGIN_NAMESPACE
The starting acceleraton of the particles emitted.
*/
/*!
- \qmlproperty qreal QtQuick.Particles2::Emitter::speedFromMovement
+ \qmlproperty qreal QtQuick.Particles2::Emitter::velocityFromMovement
If this value is non-zero, then any movement of the emitter will provide additional
starting velocity to the particles based on the movement. The additional vector will be the
same angle as the emitter's movement, with a magnitude that is the magnitude of the emitters
- movement multiplied by speedFromMovement.
+ movement multiplied by velocityFromMovement.
Default value is 0.
*/
@@ -223,7 +223,7 @@ QQuickParticleEmitter::QQuickParticleEmitter(QQuickItem *parent) :
, m_system(0)
, m_extruder(0)
, m_defaultExtruder(0)
- , m_speed(&m_nullVector)
+ , m_velocity(&m_nullVector)
, m_acceleration(&m_nullVector)
, m_particleSize(16)
, m_particleEndSize(-1)
@@ -232,13 +232,13 @@ QQuickParticleEmitter::QQuickParticleEmitter(QQuickItem *parent) :
, m_overwrite(true)
, m_pulseLeft(0)
, m_maxParticleCount(-1)
- , m_speed_from_movement(0)
+ , m_velocity_from_movement(0)
, m_reset_last(true)
, m_last_timestamp(-1)
, m_last_emission(0)
{
- //TODO: Reset speed/acc back to null vector? Or allow null pointer?
+ //TODO: Reset velocity/acc back to null vector? Or allow null pointer?
connect(this, SIGNAL(maximumEmittedChanged(int)),
this, SIGNAL(particleCountChanged()));
connect(this, SIGNAL(particlesPerSecondChanged(qreal)),
@@ -326,12 +326,12 @@ int QQuickParticleEmitter::particleCount() const
return m_particlesPerSecond*((m_particleDuration+m_particleDurationVariation)/1000.0);
}
-void QQuickParticleEmitter::setSpeedFromMovement(qreal t)
+void QQuickParticleEmitter::setVelocityFromMovement(qreal t)
{
- if (t == m_speed_from_movement)
+ if (t == m_velocity_from_movement)
return;
- m_speed_from_movement = t;
- emit speedFromMovementChanged();
+ m_velocity_from_movement = t;
+ emit velocityFromMovementChanged();
}
void QQuickParticleEmitter::reset()
@@ -439,12 +439,12 @@ void QQuickParticleEmitter::emitWindow(int timeStamp)
datum->x = newPos.x();
datum->y = newPos.y();
- // Particle speed
- const QPointF &speed = m_speed->sample(newPos);
- datum->vx = speed.x()
- + m_speed_from_movement * vx;
- datum->vy = speed.y()
- + m_speed_from_movement * vy;
+ // Particle velocity
+ const QPointF &velocity = m_velocity->sample(newPos);
+ datum->vx = velocity.x()
+ + m_velocity_from_movement * vx;
+ datum->vy = velocity.y()
+ + m_velocity_from_movement * vy;
// Particle acceleration
const QPointF &accel = m_acceleration->sample(newPos);
diff --git a/src/particles/qquickparticleemitter_p.h b/src/particles/qquickparticleemitter_p.h
index eb9e1fd591..6829798066 100644
--- a/src/particles/qquickparticleemitter_p.h
+++ b/src/particles/qquickparticleemitter_p.h
@@ -73,9 +73,9 @@ class QQuickParticleEmitter : public QQuickItem
Q_PROPERTY(qreal endSize READ particleEndSize WRITE setParticleEndSize NOTIFY particleEndSizeChanged)
Q_PROPERTY(qreal sizeVariation READ particleSizeVariation WRITE setParticleSizeVariation NOTIFY particleSizeVariationChanged)
- Q_PROPERTY(QQuickDirection *speed READ speed WRITE setSpeed NOTIFY speedChanged)
+ Q_PROPERTY(QQuickDirection *velocity READ velocity WRITE setVelocity NOTIFY velocityChanged)
Q_PROPERTY(QQuickDirection *acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged)
- Q_PROPERTY(qreal speedFromMovement READ speedFromMovement WRITE setSpeedFromMovement NOTIFY speedFromMovementChanged)
+ Q_PROPERTY(qreal velocityFromMovement READ velocityFromMovement WRITE setVelocityFromMovement NOTIFY velocityFromMovementChanged)
Q_ENUMS(Lifetime)
public:
@@ -117,8 +117,8 @@ public:
return m_particleDurationVariation;
}
- qreal speedFromMovement() const { return m_speed_from_movement; }
- void setSpeedFromMovement(qreal s);
+ qreal velocityFromMovement() const { return m_velocity_from_movement; }
+ void setVelocityFromMovement(qreal s);
virtual void componentComplete();
signals:
void emitParticles(QQmlV8Handle particles);
@@ -140,14 +140,14 @@ signals:
void particleSizeVariationChanged(qreal arg);
- void speedChanged(QQuickDirection * arg);
+ void velocityChanged(QQuickDirection * arg);
void accelerationChanged(QQuickDirection * arg);
void maximumEmittedChanged(int arg);
void particleCountChanged();
- void speedFromMovementChanged();
+ void velocityFromMovementChanged();
void startTimeChanged(int arg);
@@ -231,11 +231,11 @@ public slots:
}
}
- void setSpeed(QQuickDirection * arg)
+ void setVelocity(QQuickDirection * arg)
{
- if (m_speed != arg) {
- m_speed = arg;
- emit speedChanged(arg);
+ if (m_velocity != arg) {
+ m_velocity = arg;
+ emit velocityChanged(arg);
}
}
@@ -281,9 +281,9 @@ public:
return m_particleSizeVariation;
}
- QQuickDirection * speed() const
+ QQuickDirection * velocity() const
{
- return m_speed;
+ return m_velocity;
}
QQuickDirection * acceleration() const
@@ -311,13 +311,13 @@ protected:
QQuickParticleExtruder* m_extruder;
QQuickParticleExtruder* m_defaultExtruder;
QQuickParticleExtruder* effectiveExtruder();
- QQuickDirection * m_speed;
+ QQuickDirection * m_velocity;
QQuickDirection * m_acceleration;
qreal m_particleSize;
qreal m_particleEndSize;
qreal m_particleSizeVariation;
- qreal m_speedFromMovement;
+ qreal m_velocityFromMovement;
int m_startTime;
bool m_overwrite;
@@ -326,7 +326,7 @@ protected:
int m_maxParticleCount;
//Used in default implementation, but might be useful
- qreal m_speed_from_movement;
+ qreal m_velocity_from_movement;
int m_emitCap;
bool m_reset_last;
diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp
index 6b5fbfae0b..1cbc337488 100644
--- a/src/particles/qquickparticlesystem.cpp
+++ b/src/particles/qquickparticlesystem.cpp
@@ -460,7 +460,7 @@ QQuickParticleData::QQuickParticleData(QQuickParticleSystem* sys)
yx = 0;
yy = 1;
rotation = 0;
- rotationSpeed = 0;
+ rotationVelocity = 0;
autoRotate = 0;
animIdx = 0;
frameDuration = 1;
@@ -502,7 +502,7 @@ void QQuickParticleData::clone(const QQuickParticleData& other)
yx = other.yx;
yy = other.yy;
rotation = other.rotation;
- rotationSpeed = other.rotationSpeed;
+ rotationVelocity = other.rotationVelocity;
autoRotate = other.autoRotate;
animIdx = other.animIdx;
frameDuration = other.frameDuration;
diff --git a/src/particles/qquickparticlesystem_p.h b/src/particles/qquickparticlesystem_p.h
index 2058db6b51..3c2324af90 100644
--- a/src/particles/qquickparticlesystem_p.h
+++ b/src/particles/qquickparticlesystem_p.h
@@ -198,7 +198,7 @@ public:
float yx;
float yy;
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;//Assume that GPUs prefer floats to bools
//Used by ImageParticle Sprite mode
float animIdx;
diff --git a/src/particles/qquicktrailemitter.cpp b/src/particles/qquicktrailemitter.cpp
index 5f094105e1..86d0c16b8b 100644
--- a/src/particles/qquicktrailemitter.cpp
+++ b/src/particles/qquicktrailemitter.cpp
@@ -80,12 +80,12 @@ QQuickTrailEmitter::QQuickTrailEmitter(QQuickItem *parent) :
The type of logical particle which this is emitting from.
*/
/*!
- \qmlproperty qreal QtQuick.Particles2::TrailEmitter::speedFromMovement
+ \qmlproperty qreal QtQuick.Particles2::TrailEmitter::velocityFromMovement
If this value is non-zero, then any movement of the emitter will provide additional
starting velocity to the particles based on the movement. The additional vector will be the
same angle as the emitter's movement, with a magnitude that is the magnitude of the emitters
- movement multiplied by speedFromMovement.
+ movement multiplied by velocityFromMovement.
Default value is 0.
*/
@@ -170,7 +170,7 @@ void QQuickTrailEmitter::emitWindow(int timeStamp)
}
}
- //TODO: Implement startTime and speedFromMovement
+ //TODO: Implement startTime and velocityFromMovement
qreal time = timeStamp / 1000.;
qreal particleRatio = 1. / m_particlesPerParticlePerSecond;
qreal pt;
@@ -229,12 +229,12 @@ void QQuickTrailEmitter::emitWindow(int timeStamp)
datum->x = newPos.x();
datum->y = newPos.y();
- // Particle speed
- const QPointF &speed = m_speed->sample(newPos);
- datum->vx = speed.x()
- + m_speed_from_movement * d->vx;
- datum->vy = speed.y()
- + m_speed_from_movement * d->vy;
+ // Particle velocity
+ const QPointF &velocity = m_velocity->sample(newPos);
+ datum->vx = velocity.x()
+ + m_velocity_from_movement * d->vx;
+ datum->vy = velocity.y()
+ + m_velocity_from_movement * d->vy;
// Particle acceleration
const QPointF &accel = m_acceleration->sample(newPos);
diff --git a/src/particles/qquickv8particledata.cpp b/src/particles/qquickv8particledata.cpp
index eb9881ee78..296797f606 100644
--- a/src/particles/qquickv8particledata.cpp
+++ b/src/particles/qquickv8particledata.cpp
@@ -172,14 +172,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty real QtQuick.Particles2::Particle::rotationSpeed
+ \qmlproperty real QtQuick.Particles2::Particle::rotationVelocity
Degrees clockwise per second that the particle image is rotated at while alive.
*/
/*!
\qmlproperty bool QtQuick.Particles2::Particle::autoRotate
If autoRotate is true, then the particle's rotation will be
set so that it faces the direction of travel, plus any
- rotation from the rotation or rotationSpeed properties.
+ rotation from the rotation or rotationVelocity properties.
*/
/*!
@@ -409,7 +409,7 @@ FLOAT_GETTER_AND_SETTER(xy)
FLOAT_GETTER_AND_SETTER(yx)
FLOAT_GETTER_AND_SETTER(yy)
FLOAT_GETTER_AND_SETTER(rotation)
-FLOAT_GETTER_AND_SETTER(rotationSpeed)
+FLOAT_GETTER_AND_SETTER(rotationVelocity)
FLOAT_GETTER_AND_SETTER(animIdx)
FLOAT_GETTER_AND_SETTER(frameDuration)
FLOAT_GETTER_AND_SETTER(frameAt)
@@ -448,7 +448,7 @@ QV8ParticleDataDeletable::QV8ParticleDataDeletable(QV8Engine *engine)
REGISTER_ACCESSOR(ft, engine, yx, yDeformationVectorX);
REGISTER_ACCESSOR(ft, engine, yy, yDeformationVectorY);
REGISTER_ACCESSOR(ft, engine, rotation, rotation);
- REGISTER_ACCESSOR(ft, engine, rotationSpeed, rotationSpeed);
+ REGISTER_ACCESSOR(ft, engine, rotationVelocity, rotationVelocity);
REGISTER_ACCESSOR(ft, engine, autoRotate, autoRotate);
REGISTER_ACCESSOR(ft, engine, animIdx, animationIndex);
REGISTER_ACCESSOR(ft, engine, frameDuration, frameDuration);
diff --git a/src/particles/qquickwander.cpp b/src/particles/qquickwander.cpp
index 9def03adce..a7e6c8db04 100644
--- a/src/particles/qquickwander.cpp
+++ b/src/particles/qquickwander.cpp
@@ -120,7 +120,7 @@ WanderData* QQuickWanderAffector::getData(int idx)
bool QQuickWanderAffector::affectParticle(QQuickParticleData* data, qreal dt)
{
- /*TODO: Add a mode which does basically this - picking a direction, going in it (random speed) and then going back
+ /*TODO: Add a mode which does basically this - picking a direction, going in it (random velocity) and then going back
WanderData* d = getData(data->systemIndex);
if (m_xVariance != 0.) {
if ((d->x_vel > d->x_peak && d->x_var > 0.0) || (d->x_vel < -d->x_peak && d->x_var < 0.0)) {