}
anchors.fill: parent
- speed: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ velocity: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
shape: EllipseShape{fill:true}
enabled: false;
lifeSpan: 700; lifeSpanVariation: 100
system: particles
emitRate: 20
lifeSpan: 8000
- speed: PointDirection { y:80; yVariation: 40; }
+ velocity: PointDirection { y:80; yVariation: 40; }
acceleration: PointDirection { y: 4 }
size: 36
endSize: 12
enabled: true
size: 30
sizeVariation: 10
- speed: PointDirection { x: 220; xVariation: 40 }
+ velocity: PointDirection { x: 220; xVariation: 40 }
height: parent.height
}
Emitter {
enabled: true
size: 30
sizeVariation: 10
- speed: PointDirection { x: 220; xVariation: 40 }
+ velocity: PointDirection { x: 220; xVariation: 40 }
height: parent.height
}
ParticleSystem {
size: 10
endSize: 4
sizeVariation: 4
- speed: PointDirection { x: -128; xVariation: 32 }
+ velocity: PointDirection { x: -128; xVariation: 32 }
height: ship.height
y: ship.y
x: ship.x
lifeSpan: 1000
enabled: true
size: 40
- speed: PointDirection { x: 256; }
+ velocity: PointDirection { x: 256; }
x: ship.x + ship.width
y: ship.y + ship.height/2
}
emitRate: 4
lifeSpan: 14000
size: 80
- speed: PointDirection { y: 60 }
+ velocity: PointDirection { y: 60 }
}
Wander {
system: sys
Affector {
system: sys
property real coefficient: 0.1
- property real speed: 1.5
+ property real velocity: 1.5
width: parent.width
height: parent.height - 100
onAffectParticles: {
if (particle.r == 0) {
particle.r = Math.random() > 0.5 ? -1 : 1;
}else if (particle.r == 1) {
- particle.rotation += speed * dt;
+ particle.rotation += velocity * dt;
if(particle.rotation >= maxAngle)
particle.r = -1;
}else if (particle.r == -1) {
- particle.rotation -= speed * dt;
+ particle.rotation -= velocity * dt;
if(particle.rotation <= -1 * maxAngle)
particle.r = 1;
}
if (particle.r == 0.0) {
particle.r = Math.random() + 0.01;
}
- particle.rotation += speed * particle.r * dt;
+ particle.rotation += velocity * particle.r * dt;
particle.r -= particle.rotation * coefficient;
if (particle.r == 0.0)
particle.r -= particle.rotation * 0.000001;
emitRate: 4
lifeSpan: 14000
size: 80
- speed: PointDirection { y: 160; yVariation: 80; xVariation: 20 }
+ velocity: PointDirection { y: 160; yVariation: 80; xVariation: 20 }
}
ImageParticle {
emitWidth: 16
emitHeight: 16
- speed: PointDirection {yVariation: 16; xVariation: 16}
+ velocity: PointDirection {yVariation: 16; xVariation: 16}
acceleration: PointDirection {y: -16}
size: 24
lifeSpan: 4000//TODO: Infinite & kill zone
size: 24
sizeVariation: 4
- speed: PointDirection {x:120; xVariation: 80; yVariation: 50}
+ velocity: PointDirection {x:120; xVariation: 80; yVariation: 50}
acceleration: PointDirection {y:120}
group: "unlit"
}
size: 24
sizeVariation: 2
endSize: 0
- speed: PointDirection { y:-100; yVariation: 4; xVariation: 4 }
+ velocity: PointDirection { y:-100; yVariation: 4; xVariation: 4 }
// ![groupgoal-pilot]
GroupGoal {
groups: ["unlit"]
lifeSpan: 2800
size: 32
sizeVariation: 8
- speed: PointDirection{ x: 66; xVariation: 20 }
+ velocity: PointDirection{ x: 66; xVariation: 20 }
width: 80
height: 80
}
lifeSpan: 2800
size: 32
sizeVariation: 8
- speed: PointDirection{ x: 240; xVariation: 60 }
+ velocity: PointDirection{ x: 240; xVariation: 60 }
y: 260
width: 10
height: 10
width: 80
height: 80
once: true
- speed: AngleDirection { angleVariation:360; magnitude: 72 }
+ velocity: AngleDirection { angleVariation:360; magnitude: 72 }
}
//! [B]
lifeSpan: 2800
size: 32
sizeVariation: 8
- speed: PointDirection{ x: 80; xVariation: 10 }
+ velocity: PointDirection{ x: 80; xVariation: 10 }
acceleration: PointDirection { y: 10; x: 20; }
width: 80
height: 80
anchors.centerIn: parent
- //acceleration: AngledDirection {angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed?
+ //acceleration: AngledDirection {angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent velocity?
acceleration: PointDirection { xVariation: 200; yVariation: 200; }
size: 0
y: holder.y
x: holder.x
- speed: PointDirection { xVariation: 40; yVariation: 40; }
- speedFromMovement: 16
+ velocity: PointDirection { xVariation: 40; yVariation: 40; }
+ velocityFromMovement: 16
acceleration: PointDirection { xVariation: 10; yVariation: 10; }
endSize: 10
sizeVariation: 10
acceleration: PointDirection { y: -40 }
- speed: AngleDirection { angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
+ velocity: AngleDirection { angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
}
TrailEmitter {
id: smoke1
endSize: 8
sizeVariation: 8
acceleration: PointDirection { y: -40 }
- speed: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
+ velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
}
TrailEmitter {
id: smoke2
endSize: 24
sizeVariation: 12
acceleration: PointDirection { y: -40 }
- speed: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
+ velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
}
}
system: particles
emitRate: 20
lifeSpan: 7000
- speed: PointDirection { y:80; yVariation: 40; }
+ velocity: PointDirection { y:80; yVariation: 40; }
acceleration: PointDirection { y: 4 }
size: 20
sizeVariation: 10
height: parent.height
emitRate: 1
lifeSpan: 12000
- speed: PointDirection {x:20;}
+ velocity: PointDirection {x:20;}
size: 128
}
ShaderEffectSource {
lifeSpan: 8000
size: 24
sizeVariation: 16
- speed: PointDirection {x: root.width/10; y: root.height/10;}
+ velocity: PointDirection {x: root.width/10; y: root.height/10;}
//acceleration: AngledDirection {angle:225; magnitude: root.width/36; angleVariation: 45; magnitudeVariation: 80}
acceleration: PointDirection {x: -root.width/40; y: -root.height/40; xVariation: -root.width/20; yVariation: -root.width/20}
}
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);
emitRate: 2000
lifeSpan: 2000
enabled: false
- speed: AngleDirection{magnitude: 64; angleVariation: 360}
+ velocity: AngleDirection{magnitude: 64; angleVariation: 360}
size: 24
sizeVariation: 8
}
sizeVariation: 2
endSize: 0
shape: EllipseShape {fill: false}
- speed: TargetDirection {
+ velocity: TargetDirection {
targetX: root.width/2
targetY: root.height/2
proportionalMagnitude: true
sizeVariation: 2
endSize: 16
shape: EllipseShape {fill: false}
- speed: TargetDirection {
+ velocity: TargetDirection {
targetX: root.width/2
targetY: root.height/2
proportionalMagnitude: true
lifeSpan: 1000
maximumEmitted: 1200
size: 8
- speed: AngleDirection {angle: 270; angleVariation: 45; magnitude: 20; magnitudeVariation: 20;}
+ velocity: AngleDirection {angle: 270; angleVariation: 45; magnitude: 20; magnitudeVariation: 20;}
acceleration: PointDirection {y:100; yVariation: 20}
}
}
enabled: false
emitRate: 80
lifeSpan: 6000
- speed: PointDirection {y:-100;}
+ velocity: PointDirection {y:-100;}
size: 32
}
lifeSpan: 1600
maximumEmitted: 6400
size: 8
- speed: CumulativeDirection {
+ velocity: CumulativeDirection {
PointDirection {y:-100}
AngleDirection {angleVariation: 360; magnitudeVariation: 80;}
}
lifeSpan: 3500
acceleration: PointDirection { y: -17; xVariation: 3 }
- speed: PointDirection {xVariation: 3}
+ velocity: PointDirection {xVariation: 3}
size: 24
sizeVariation: 8
emitRatePerParticle: 1
lifeSpan: 2000
- speed: PointDirection {y:-17*6; yVariation: -17; xVariation: 3}
+ velocity: PointDirection {y:-17*6; yVariation: -17; xVariation: 3}
acceleration: PointDirection {xVariation: 3}
size: 36
emitHeight: TrailEmitter.ParticleSize
emitShape: EllipseShape{}
- speed: PointDirection {yVariation: 16; xVariation: 16}
+ velocity: PointDirection {yVariation: 16; xVariation: 16}
acceleration: PointDirection {y: -16}
size: 24
emitRate: 2
lifeSpan: 7000
- speed: PointDirection {y:-17*4*2; xVariation: 6*6}
+ velocity: PointDirection {y:-17*4*2; xVariation: 6*6}
acceleration: PointDirection {y: 17*2; xVariation: 6*6}
size: 8
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
- speed: PointDirection {xVariation: 4; yVariation: 4;}
+ velocity: PointDirection {xVariation: 4; yVariation: 4;}
acceleration: PointDirection {xVariation: 10; yVariation: 10;}
- speedFromMovement: 8
+ velocityFromMovement: 8
size: 8
sizeVariation: 4
y: mouseArea.pressed ? mouseArea.mouseY : circle.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle.cx
- speed: PointDirection {xVariation: 4; yVariation: 4;}
+ velocity: PointDirection {xVariation: 4; yVariation: 4;}
acceleration: PointDirection {xVariation: 10; yVariation: 10;}
- speedFromMovement: 8
+ velocityFromMovement: 8
size: 22
sizeVariation: 4
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
- speedFromMovement: 16
+ velocityFromMovement: 16
- speed: PointDirection {xVariation: 4; yVariation: 4;}
+ velocity: PointDirection {xVariation: 4; yVariation: 4;}
acceleration: PointDirection {xVariation: 10; yVariation: 10;}
size: 12
y: mouseArea.pressed ? mouseArea.mouseY : circle2.cy
x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx
- speedFromMovement: 16
- speed: PointDirection {xVariation: 2; yVariation: 2;}
+ velocityFromMovement: 16
+ velocity: PointDirection {xVariation: 2; yVariation: 2;}
acceleration: PointDirection {xVariation: 10; yVariation: 10;}
size: 22
}
]
colorVariation: 0.5
- rotationSpeedVariation: 360
+ rotationVelocityVariation: 360
system: sys
colorTable: "../trails/../images/colortable.png"
}
id: particles
emitRate: 200
lifeSpan: 6000
- speed: AngleDirection {angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
+ velocity: AngleDirection {angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
size: 60
endSize: 120
}
lifeSpan: 2400
size: 48
sizeVariation: 8
- speed: AngleDirection {angleVariation: 180; magnitude: 60}
+ velocity: AngleDirection {angleVariation: 180; magnitude: 60}
}
Turbulence {
from: 0; to: Math.PI * 2; duration: 10000; loops: Animation.Infinite
}
- speedFromMovement: 20
+ velocityFromMovement: 20
- speed: PointDirection { xVariation: 5; yVariation: 5;}
+ velocity: PointDirection { xVariation: 5; yVariation: 5;}
acceleration: PointDirection { xVariation: 5; yVariation: 5;}
size: 16
groups: ["goingLeft", "goingRight"]
source: "../images/starfish_4.png"
rotation: 90
- rotationSpeed: 90
+ rotationVelocity: 90
autoRotation: true
}
ImageParticle {
system: sys
enabled: false
group: "goingRight"
- speed: PointDirection { x: 100 }
+ velocity: PointDirection { x: 100 }
lifeSpan: 4000
emitRate: 1
size: 128
system: sys
enabled: false
group: "goingLeft"
- speed: PointDirection { x: -100 }
+ velocity: PointDirection { x: -100 }
lifeSpan: 4000
emitRate: 1
size: 128
system: sys
enabled: false
group: "goingDown"
- speed: PointDirection { x: 100 }
+ velocity: PointDirection { x: 100 }
lifeSpan: 4000
emitRate: 1
size: 128
emitRate: 10
size: 200
lifeSpan: 10000
- speed: AngleDirection {angleVariation: 360; magnitudeVariation: 100;}
+ velocity: AngleDirection {angleVariation: 360; magnitudeVariation: 100;}
}
MouseArea {
lifeSpan: 10000
size: 24
sizeVariation: 8
- speed: AngleDirection { angleVariation: 360; magnitude: 3 }
+ velocity: AngleDirection { angleVariation: 360; magnitude: 3 }
maximumEmitted: 10
startTime: 5000
}
system: sys
emitRate: 2
lifeSpan: 10000
- speed: AngleDirection {angle: 90; magnitude: 60; angleVariation: 5}
+ velocity: AngleDirection {angle: 90; magnitude: 60; angleVariation: 5}
acceleration: PointDirection { y: 10 }
size: 160
sizeVariation: 40
emitRate: 1
lifeSpan: 4800
lifeSpanVariation: 1600
- speed: AngleDirection {angleVariation: 360; magnitude: 40; magnitudeVariation: 20}
+ velocity: AngleDirection {angleVariation: 360; magnitude: 40; magnitudeVariation: 20}
}
ItemParticle {
delegate: Text {
height: parent.height - 132/2
x: -132/2
y: 132/2
- speed: PointDirection { x: 32; xVariation: 8 }
+ velocity: PointDirection { x: 32; xVariation: 8 }
emitRate: 0.5
lifeSpan: Emitter.InfiniteLife
group: "photos"
}
Emitter {
id: centerEmitter
- speed: PointDirection { x: 32; xVariation: 8;}
+ velocity: PointDirection { x: 32; xVariation: 8;}
emitRate: 0.5
lifeSpan: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
maximumEmitted: 20
enabled: false
size: 32
endSize: 8
- speed: AngleDirection { magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
+ velocity: AngleDirection { magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
acceleration: PointDirection { y: 160 }
}
Item { x: -1000; y: -1000 //offscreen
id: emitter
system: sys
width: parent.width/2
- speed: PointDirection {y: 72; yVariation: 24}
+ velocity: PointDirection {y: 72; yVariation: 24}
lifeSpan: 10000
emitRate: 1000
enabled: false
lifeSpan: 600
size: 16
endSize: 8
- speed: AngleDirection {angleVariation:360; magnitude: 60}
+ velocity: AngleDirection {angleVariation:360; magnitude: 60}
}
property int life: 2600
emitRate: 200
lifeSpan: 4000
startTime: 4000
- speed: PointDirection { y: -120; }
+ velocity: PointDirection { y: -120; }
}
ImageParticle {
lifeSpan: 4000 + 800*(16-emitRate)
maximumEmitted: 128
size: 64
- speed: PointDirection{ y: 40 + 10 * emitter.emitRate }
+ velocity: PointDirection{ y: 40 + 10 * emitter.emitRate }
}
Emitter {
emitRate: 1000
size: 16
endSize: 8
- speed: CumulativeDirection { AngleDirection {angleVariation: 180; magnitudeVariation: 120;} PointDirection { y: -60 }}
+ velocity: CumulativeDirection { AngleDirection {angleVariation: 180; magnitudeVariation: 120;} PointDirection { y: -60 }}
lifeSpan: 400
}
Emitter {
emitRate: 1000
size: 16
endSize: 8
- speed: AngleDirection {angleVariation: 180; magnitudeVariation: 180;}
+ velocity: AngleDirection {angleVariation: 180; magnitudeVariation: 180;}
lifeSpan: 600
}
Emitter {
emitRate: 1000
size: 16
endSize: 8
- speed: CumulativeDirection { AngleDirection {angleVariation: 180; magnitudeVariation: 80;} PointDirection { y: 40 }}
+ velocity: CumulativeDirection { AngleDirection {angleVariation: 180; magnitudeVariation: 80;} PointDirection { y: 40 }}
lifeSpan: 600
}
}
Emitter {
id: emitter
- speedFromMovement: 20
+ velocityFromMovement: 20
emitRate: 80
lifeSpan: 1500
- speed: PointDirection{ y: -90; yVariation: 50; }
+ velocity: PointDirection{ y: -90; yVariation: 50; }
acceleration: PointDirection{ xVariation: 100; yVariation: 90; }
size: 51
sizeVariation: 53
*/
/*!
- \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.
*/
/*!
\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.
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)
{
{
//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) {
}
}
- 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;
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:
return m_position;
}
- QQuickDirection * speed() const
+ QQuickDirection * velocity() const
{
- return m_speed;
+ return m_velocity;
}
QQuickDirection * acceleration() const
m_position = &m_nullVector;
}
- void speedReset()
+ void velocityReset()
{
- m_speed = &m_nullVector;
+ m_velocity = &m_nullVector;
}
void accelerationReset()
void positionChanged(QQuickDirection * arg);
- void speedChanged(QQuickDirection * arg);
+ void velocityChanged(QQuickDirection * arg);
void accelerationChanged(QQuickDirection * arg);
}
}
- 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);
}
}
private:
void affectProperties(const QList<QQuickParticleData*> particles, qreal dt);
QQuickDirection * m_position;
- QQuickDirection * m_speed;
+ QQuickDirection * m_velocity;
QQuickDirection * m_acceleration;
QQuickDirection m_nullVector;
"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"
" 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"
"}";
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;
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);
}
\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
*/
"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"
" 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"
*/
/*!
- \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.
*/
, 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)
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)
d->rotationOwner = 0;
m_rotation = 0;
m_rotationVariation = 0;
- m_rotationSpeed = 0;
- m_rotationSpeedVariation = 0;
+ m_rotationVelocity = 0;
+ m_rotationVelocityVariation = 0;
m_autoRotation = false;
}
} 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
}
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;
switch (perfLevel){//Fall-through is intended on all of them
case Sprites:
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;
}
}
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
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) {
float yx;
float yy;
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;//Assumed that GPUs prefer floats to bools
};
float yx;
float yy;
float rotation;
- float rotationSpeed;
+ float rotationVelocity;
float autoRotate;//Assumed that GPUs prefer floats to bools
float animW;
float animH;
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)
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; }
void rotationVariationChanged(qreal arg);
- void rotationSpeedChanged(qreal arg);
+ void rotationVelocityChanged(qreal arg);
- void rotationSpeedVariationChanged(qreal arg);
+ void rotationVelocityVariationChanged(qreal arg);
void autoRotationChanged(bool arg);
void setRotationVariation(qreal arg);
- void setRotationSpeed(qreal arg);
+ void setRotationVelocity(qreal arg);
- void setRotationSpeedVariation(qreal arg);
+ void setRotationVelocityVariation(qreal arg);
void setAutoRotation(bool arg);
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;
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
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.
*/
, 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)
, 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)),
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()
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);
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:
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);
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);
}
}
- 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);
}
}
return m_particleSizeVariation;
}
- QQuickDirection * speed() const
+ QQuickDirection * velocity() const
{
- return m_speed;
+ return m_velocity;
}
QQuickDirection * acceleration() const
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;
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;
yx = 0;
yy = 1;
rotation = 0;
- rotationSpeed = 0;
+ rotationVelocity = 0;
autoRotate = 0;
animIdx = 0;
frameDuration = 1;
yx = other.yx;
yy = other.yy;
rotation = other.rotation;
- rotationSpeed = other.rotationSpeed;
+ rotationVelocity = other.rotationVelocity;
autoRotate = other.autoRotate;
animIdx = other.animIdx;
frameDuration = other.frameDuration;
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;
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.
*/
}
}
- //TODO: Implement startTime and speedFromMovement
+ //TODO: Implement startTime and velocityFromMovement
qreal time = timeStamp / 1000.;
qreal particleRatio = 1. / m_particlesPerParticlePerSecond;
qreal pt;
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);
*/
/*!
- \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.
*/
/*!
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)
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);
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)) {
size: 32
emitRate: 1000
lifeSpan: 500
- speed: PointDirection{ x: 500; y: 500 }
+ velocity: PointDirection{ x: 500; y: 500 }
}
}
}
size: 32
emitRate: 1000
lifeSpan: 500
- speed: PointDirection{ x: 1000; y: 1000 }
+ velocity: PointDirection{ x: 1000; y: 1000 }
}
}
}
size: 32
emitRate: 1000
lifeSpan: 500
- speed: PointDirection{ x: 500; y: 500 }
+ velocity: PointDirection{ x: 500; y: 500 }
}
}
}
size: 32
emitRate: 1000
lifeSpan: 500
- speed: PointDirection{ x: 500; y: 500 }
+ velocity: PointDirection{ x: 500; y: 500 }
}
}
}
size: 32
emitRate: 1000
lifeSpan: 500
- speed: AngleDirection { angle: 45; magnitude: 500 }
+ velocity: AngleDirection { angle: 45; magnitude: 500 }
acceleration: AngleDirection { angle: 45; angleVariation: 22; magnitude: 250; magnitudeVariation: 249}
}
}
size: 32
emitRate: 1000
lifeSpan: 500
- speed: CumulativeDirection {
+ velocity: CumulativeDirection {
PointDirection { x: 100; y: -100 }
PointDirection { x: -100; y: 100 }
}
once: false
relative: false
position: PointDirection { x: 50; y: 50; }
- speed: PointDirection { x: 50; y: 50; }
+ velocity: PointDirection { x: 50; y: 50; }
acceleration: PointDirection { x: 50; y: 50; }
}
}
Emitter{
//0,0 position
- speed: PointDirection{x:100}
+ velocity: PointDirection{x:100}
size: 32
emitRate: 1000
lifeSpan: 500
//0,0 position
group: "notdefault"
y:200
- speed: PointDirection{x:100}
+ velocity: PointDirection{x:100}
size: 32
emitRate: 1000
lifeSpan: 500
}
Friction {
- factor: 1000 //speed limit 50
+ factor: 1000 //velocity limit 50
threshold: 50
}
Emitter{
//0,0 position
- speed: PointDirection{x:1000}
+ velocity: PointDirection{x:1000}
size: 32
emitRate: 1000
lifeSpan: 500
QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
ensureAnimTime(600, system->m_animation);
- //Speed capped at 50, but it might take a frame or two to get there
+ //Velocity capped at 50, but it might take a frame or two to get there
QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 500, 10));
foreach (QQuickParticleData *d, system->groupData[0]->data) {
if (d->t == -1.0f)
ImageParticle {
source: "../../shared/star.png"
rotation: 90
- rotationSpeed: 90
+ rotationVelocity: 90
autoRotation: true
yVector: PointDirection{x: 0.5; y: 0.5}
xVector: PointDirection{x: 0.5; y: 0.5}
QCOMPARE(d->yy, 1.0f);
QCOMPARE(d->yx, 0.0f);
QCOMPARE(d->rotation, 0.0f);
- QCOMPARE(d->rotationSpeed, 0.0f);
+ QCOMPARE(d->rotationVelocity, 0.0f);
QCOMPARE(d->autoRotate, 0.0f);
QCOMPARE(d->animX, 0.0f);
QCOMPARE(d->animY, 0.0f);
QCOMPARE(d->yy, 1.0f);
QCOMPARE(d->yx, 0.0f);
QCOMPARE(d->rotation, 0.0f);
- QCOMPARE(d->rotationSpeed, 0.0f);
+ QCOMPARE(d->rotationVelocity, 0.0f);
QCOMPARE(d->autoRotate, 0.0f);
QCOMPARE(d->animX, 0.0f);
QCOMPARE(d->animY, 0.0f);
QCOMPARE(d->yy, 1.0f);
QCOMPARE(d->yx, 0.0f);
QCOMPARE(d->rotation, 0.0f);
- QCOMPARE(d->rotationSpeed, 0.0f);
+ QCOMPARE(d->rotationVelocity, 0.0f);
QCOMPARE(d->autoRotate, 0.0f);
QCOMPARE(d->animX, 0.0f);
QCOMPARE(d->animY, 0.0f);
QCOMPARE(d->yy, 0.5f);
QCOMPARE(d->yx, 0.5f);
QCOMPARE(d->rotation, 90.0f * (float)CONV_FACTOR);
- QCOMPARE(d->rotationSpeed, 90.0f * (float)CONV_FACTOR);
+ QCOMPARE(d->rotationVelocity, 90.0f * (float)CONV_FACTOR);
QCOMPARE(d->autoRotate, 1.0f);
QCOMPARE(d->animX, 0.0f);
QCOMPARE(d->animY, 0.0f);
QCOMPARE(d->yy, 1.0f);
QCOMPARE(d->yx, 0.0f);
QCOMPARE(d->rotation, 0.0f);
- QCOMPARE(d->rotationSpeed, 0.0f);
+ QCOMPARE(d->rotationVelocity, 0.0f);
QCOMPARE(d->autoRotate, 0.0f);
QCOMPARE(d->animX, 0.0f);
QCOMPARE(d->animY, 0.0f);
QCOMPARE(d->yy, 1.0f);
QCOMPARE(d->yx, 0.0f);
QCOMPARE(d->rotation, 0.0f);
- QCOMPARE(d->rotationSpeed, 0.0f);
+ QCOMPARE(d->rotationVelocity, 0.0f);
QCOMPARE(d->autoRotate, 0.0f);
QVERIFY(myFuzzyCompare(d->frameDuration, 120.f));
QCOMPARE(d->frameCount, 6.0f);
Emitter{
//0,0 position
size: 32
- speed: PointDirection{ x: 100; y: 100 }
+ velocity: PointDirection{ x: 100; y: 100 }
acceleration: PointDirection{ x: 100; xVariation: 100; y: 100; yVariation: 100 }
emitRate: 1000
lifeSpan: 500
Emitter{
//0,0 position
- speed: TargetDirection{ targetItem: sys; proportionalMagnitude: true; magnitude: 1 }
+ velocity: TargetDirection{ targetItem: sys; proportionalMagnitude: true; magnitude: 1 }
size: 32
emitRate: 1000
lifeSpan: 500
size: 32
emitRatePerParticle: 2
lifeSpan: 500
- speed: PointDirection{ x: 500; y: 500 }
+ velocity: PointDirection{ x: 500; y: 500 }
}
Emitter{
x: 4
}
anchors.fill: parent
- speed: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ velocity: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
shape: EllipseShape{fill:true}
enabled: false;
lifeSpan: 700; lifeSpanVariation: 100
height: 5
emitRate: 100
lifeSpan: 10000
- speed: AngleDirection { angle: 0; magnitude: 30 }
+ velocity: AngleDirection { angle: 0; magnitude: 30 }
}
// Affectors
emitRate: 50
lifeSpan: 4000
size: 20
- speed: angledirectionelement
+ velocity: angledirectionelement
AngleDirection { id: angledirectionelement; angle: -75; angleVariation: 5; magnitude: 150 }
TargetDirection { id: targetdirectionelement; targetItem: targetbox; targetVariation: 10; magnitude: 150 }
PointDirection { id: pointdirectionelement; y: -100; xVariation: 10; yVariation: 10; }
"Next, let's change the Emitter to target an item." }
},
State { name: "ontarget"; when: statenum == 2
- PropertyChanges { target: emitter; speed: targetdirectionelement }
+ PropertyChanges { target: emitter; velocity: targetdirectionelement }
PropertyChanges { target: targeticon; height: 50; width: 50 }
PropertyChanges { target: directionelementtest
testtext: "The particles should be directed at the rectangle.\n"+
"Next, let's set an arbritary point to direct the particles to." }
},
State { name: "onpoint"; when: statenum == 3
- PropertyChanges { target: emitter; speed: pointdirectionelement }
+ PropertyChanges { target: emitter; velocity: pointdirectionelement }
PropertyChanges { target: directionelementtest
testtext: "The particles should be directed upwards with a small amount of spread.\n"+
"Next, let's create a fountain with CumulativeDirection and a downward PointDirection" }
},
State { name: "cumulative"; when: statenum == 4
- PropertyChanges { target: emitter; emitRate: 200; speed: cumulativedirectionelement
+ PropertyChanges { target: emitter; emitRate: 200; velocity: cumulativedirectionelement
acceleration: pointdirectionelementdownward }
PropertyChanges { target: imgparticle; color: "aqua"; colorVariation: .2 }
PropertyChanges { target: directionelementtest
Emitter {
id: emitterelement
anchors.centerIn: parent
- property int emitspeed: 10
+ property int emitvelocity: 10
emitRate: 5
lifeSpan: 1000
- speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: emitterelement.emitspeed }
+ velocity: AngleDirection { angle: 0; angleVariation: 360; magnitude: emitterelement.emitvelocity }
}
}
PropertyChanges { target: emitterelementtest
testtext: "This is an Emitter element, visualized by an ImageParticle. It should be emitting particles "+
"slowly from the center of the display.\n"+
- "Next, let's change the emission speed of the particles." }
+ "Next, let's change the emission velocity of the particles." }
},
State { name: "fast"; when: statenum == 2
- PropertyChanges { target: emitterelement; emitspeed: 50 }
+ PropertyChanges { target: emitterelement; emitvelocity: 50 }
PropertyChanges { target: emitterelementtest
testtext: "The particles emitted should be moving more quickly.\n"+
"Next, let's increase the number of particles emitted." }
},
State { name: "many"; when: statenum == 3
- PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100 }
+ PropertyChanges { target: emitterelement; emitvelocity: 50; emitRate: 100 }
PropertyChanges { target: emitterelementtest
testtext: "The particles should now be quick and numerous.\n"+
"Next, let's allow them to survive longer." }
},
State { name: "enduring"; when: statenum == 4
- PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100; lifeSpan: 3000 }
+ PropertyChanges { target: emitterelement; emitvelocity: 50; emitRate: 100; lifeSpan: 3000 }
PropertyChanges { target: emitterelementtest
testtext: "The particles should now be enduring to the edges of the display.\n"+
"Next, let's have them changing their size." }
},
State { name: "sized"; when: statenum == 5
- PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100; lifeSpan: 3000; size: 20; endSize: 5 }
+ PropertyChanges { target: emitterelement; emitvelocity: 50; emitRate: 100; lifeSpan: 3000; size: 20; endSize: 5 }
PropertyChanges { target: emitterelementtest
testtext: "The particles should now be starting large and ending small.\n"+
"Advance to restart the test." }
anchors.centerIn: parent
emitRate: 50
lifeSpan: 3000
- speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 60 }
+ velocity: AngleDirection { angle: 0; angleVariation: 360; magnitude: 60 }
}
}
"Next, let's get them spinning." }
},
State { name: "spinning"; when: statenum == 3
- PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationSpeed: 100 }
+ PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationVelocity: 100 }
PropertyChanges { target: imageparticleelementtest
testtext: "The particles should now be green and spinning.\n"+
"Next, let's get them popping in and out." }
},
State { name: "scaling"; when: statenum == 4
- PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationSpeed: 100; entryEffect: ImageParticle.Scale }
+ PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationVelocity: 100; entryEffect: ImageParticle.Scale }
PropertyChanges { target: imageparticleelementtest
testtext: "The particles should now be scaling in and out.\n"+
"Advance to restart the test." }
id: particleemitter
x: 50; y: 200
emitRate: 100
- speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 100 }
+ velocity: AngleDirection { angle: 0; angleVariation: 360; magnitude: 100 }
Rectangle { anchors.centerIn: parent; height: 1; width: 1; color: "black" }
SequentialAnimation {
running: true; paused: particlesystemelement.paused; loops: Animation.Infinite
anchors.fill: parent
emitRate: 500
lifeSpan: 2000
- speed: TargetDirection {
+ velocity: TargetDirection {
targetX: particlesystem.width/2
targetY: particlesystem.height/2
proportionalMagnitude: true
anchors.fill: parent
emitRate: 200
lifeSpan: 1000
- speed: TargetDirection {
+ velocity: TargetDirection {
targetX: particlesystem.width/2
targetY: particlesystem.height/2
proportionalMagnitude: true
emitRate: 1
lifeSpan: 3000
size: 20
- speed: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 }
+ velocity: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 }
group: "orangemissile"
}
Emitter {
emitRate: 1
lifeSpan: 3000
size: 20
- speed: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 }
+ velocity: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 }
group: "greenmissile"
}
Gravity {
anchors.fill: parent
emitRatePerParticle: 50
lifeSpan: 1000
- speedFromMovement: .2
- speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 5 }
+ velocityFromMovement: .2
+ velocity: AngleDirection { angle: 0; angleVariation: 360; magnitude: 5 }
maximumEmitted: 500
shape: basicshape
}
system: ps
anchors.fill: parent
enabled: false
- speed: AngleDirection {
+ velocity: AngleDirection {
angle: 0
angleVariation: 360
magnitude: 50
system: ps
anchors.fill: parent
enabled: false
- speed: AngleDirection {
+ velocity: AngleDirection {
angle: 0
angleVariation: 360
magnitude: 50
anchors.fill: parent
enabled: item.movn
emitRate: parts
- speed: AngleDirection {
+ velocity: AngleDirection {
angle: 0
angleVariation: 360
magnitude: 2