aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickcustomparticle.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/qquickcustomparticle.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/qquickcustomparticle.cpp')
-rw-r--r--src/particles/qquickcustomparticle.cpp8
1 files changed, 4 insertions, 4 deletions
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);
}