From 984f21f18d1a3981e7363df467ff2e24e69aa847 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 7 Jun 2011 19:39:38 +1000 Subject: [PATCH] Immense Particles Refactor Part B Examples work again. Also augmented Wander and PointAttractor with physics modes. --- examples/declarative/particles/allsmiles/plain.qml | 26 ++++ examples/declarative/particles/allsmiles/smile.qml | 94 +++++++++++++-- .../particles/allsmiles/smilefactory.qml | 20 ++-- .../particles/allsmiles/spriteparticles.qml | 16 ++-- .../particles/allsmiles/spritestateparticles.qml | 10 +- .../particles/allsmiles/spritevariedparticles.qml | 10 +- .../particles/allsmiles/ultraparticles.qml | 8 +- .../declarative/particles/asteroid/asteroid.qml | 26 ++-- .../declarative/particles/asteroid/blackhole.qml | 26 ++-- .../declarative/particles/custom/blurparticles.qml | 125 ++++++++++++++++++++ .../declarative/particles/custom/content/smile.png | Bin 0 -> 15408 bytes .../particles/modelparticles/bubbles.qml | 13 +- .../particles/modelparticles/gridsplosion.qml | 20 ++-- .../particles/modelparticles/package.qml | 8 +- .../particles/modelparticles/stream.qml | 32 ++--- .../declarative/particles/snow/content/Button.qml | 73 ++++++++++++ examples/declarative/particles/snow/snow.qml | 34 ++++-- examples/declarative/particles/snow/snow2.qml | 74 ------------ examples/declarative/particles/snow/snow3.qml | 80 ------------- .../particles/spaceexplorer/spaceexplorer.qml | 45 ++++--- .../particles/trails/dynamicemitters.qml | 10 +- .../declarative/particles/trails/fireballs.qml | 28 ++-- examples/declarative/particles/trails/layered.qml | 24 ++--- examples/declarative/particles/trails/list.qml | 6 +- .../declarative/particles/trails/overburst.qml | 8 +- examples/declarative/particles/trails/portal.qml | 18 ++-- examples/declarative/particles/trails/rainbow.qml | 10 +- examples/declarative/particles/trails/shimmer.qml | 6 +- examples/declarative/particles/trails/swarm.qml | 78 ------------ examples/declarative/particles/trails/trails.qml | 12 +- .../declarative/particles/trails/turbulence.qml | 20 ++-- .../particles/trails/velocityfrommotion.qml | 34 +++--- src/declarative/particles/qsgmaskextruder.cpp | 11 ++- src/declarative/particles/qsgparticleaffector_p.h | 1 - src/declarative/particles/qsgpointattractor.cpp | 32 ++++- src/declarative/particles/qsgpointattractor_p.h | 48 ++++++++ src/declarative/particles/qsgwander.cpp | 36 ++++++- src/declarative/particles/qsgwander_p.h | 29 +++++- 38 files changed, 679 insertions(+), 472 deletions(-) create mode 100644 examples/declarative/particles/allsmiles/plain.qml create mode 100644 examples/declarative/particles/custom/blurparticles.qml create mode 100644 examples/declarative/particles/custom/content/smile.png create mode 100644 examples/declarative/particles/snow/content/Button.qml delete mode 100644 examples/declarative/particles/snow/snow2.qml delete mode 100644 examples/declarative/particles/snow/snow3.qml delete mode 100644 examples/declarative/particles/trails/swarm.qml diff --git a/examples/declarative/particles/allsmiles/plain.qml b/examples/declarative/particles/allsmiles/plain.qml new file mode 100644 index 0000000..1b456b0 --- /dev/null +++ b/examples/declarative/particles/allsmiles/plain.qml @@ -0,0 +1,26 @@ +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Rectangle{ + color: "goldenrod" + width: 2000 + height: 2000 + ParticleSystem{id: sys} + ImageParticle{ + id: up + system: sys + image: "content/singlesmile.png" + } + Emitter{ + anchors.centerIn: parent + system: sys + particlesPerSecond: 1000 + particleSize: 20 + particleDuration: 10000 + speed: AngledDirection{angleVariation: 360; magnitudeVariation: 100;} + } + MouseArea{ + anchors.fill: parent + onClicked: up.autoRotation = !up.autoRotation + } +} diff --git a/examples/declarative/particles/allsmiles/smile.qml b/examples/declarative/particles/allsmiles/smile.qml index e37e8fa..9ce0e3a 100644 --- a/examples/declarative/particles/allsmiles/smile.qml +++ b/examples/declarative/particles/allsmiles/smile.qml @@ -39,27 +39,93 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ + id: root color: "white" width: 310 height: 300 ParticleSystem{ id: sys } - Picture{ + CustomParticle{ system: sys - anchors.fill: parent - image: "content/singlesmile.png" - onceOff: true - } - ColoredParticle{ - system: sys - image: "content/particle.png" - color: "black" - alpha: 0.4 - sizeTable: "content/sizeInOut.png" + property real maxWidth: root.width + property real maxHeight: root.height + ShaderEffectSource{ + id: pictureSource + sourceItem: picture + hideSource: true + } + Image{ + id: picture + source: "content/singlesmile.png" + } + ShaderEffectSource{ + id: particleSource + sourceItem: particle + hideSource: true + } + Image{ + id: particle + source: "content/particle.png" + } + vertexShader:" + attribute highp vec2 vPos; + attribute highp vec2 vTex; + attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize + attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration + attribute highp float r; + + uniform highp float maxWidth; + uniform highp float maxHeight; + + uniform highp mat4 qt_ModelViewProjectionMatrix; + uniform highp float timestamp; + uniform lowp float qt_Opacity; + + varying highp vec2 fTex; + varying highp vec2 fTex2; + varying lowp float fFade; + + void main() { + fTex = vTex; + fTex2 = vec2(vPos.x / maxWidth, vPos.y / maxHeight); + highp float size = vData.z; + highp float endSize = vData.w; + + highp float t = (timestamp - vData.x) / vData.y; + + highp float currentSize = mix(size, endSize, t * t); + + if (t < 0. || t > 1.) + currentSize = 0.; + + highp vec2 pos = vPos + - currentSize / 2. + currentSize * vTex // adjust size + + vVec.xy * t * vData.y // apply speed vector.. + + 0.5 * vVec.zw * pow(t * vData.y, 2.); + + gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1); + + highp float fadeIn = min(t * 10., 1.); + highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.)); + + fFade = fadeIn * fadeOut * qt_Opacity; + } + " + property variant particleTexture: particleSource + property variant pictureTexture: pictureSource + fragmentShader: " + uniform sampler2D particleTexture; + uniform sampler2D pictureTexture; + varying highp vec2 fTex; + varying highp vec2 fTex2; + varying highp float fFade; + void main() { + gl_FragColor = texture2D(pictureTexture, fTex2) * texture2D(particleTexture, fTex).w * fFade; + }" } - TrailEmitter{ + Emitter{ id: emitter system: sys emitting: false @@ -67,7 +133,7 @@ Rectangle{ maxParticles: 1200 anchors.fill: parent particleSize: 32 - speed: PointVector{ xVariation: 12; yVariation: 12 } + speed: PointDirection{ xVariation: 12; yVariation: 12 } } MouseArea{ anchors.fill: parent diff --git a/examples/declarative/particles/allsmiles/smilefactory.qml b/examples/declarative/particles/allsmiles/smilefactory.qml index 47becb5..262644e 100644 --- a/examples/declarative/particles/allsmiles/smilefactory.qml +++ b/examples/declarative/particles/allsmiles/smilefactory.qml @@ -39,14 +39,14 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "goldenrod" width: 400 height: 400 ParticleSystem{id:sys} - DeformableParticle{ + ImageParticle{ system: sys particles: ["goingLeft", "goingRight"] image: "content/singlesmile.png" @@ -54,12 +54,12 @@ Rectangle{ rotationSpeed: 90 autoRotation: true } - DeformableParticle{ + ImageParticle{ system: sys particles: ["goingDown"] image: "content/squarefacespriteXX.png" rotation: 180 - yVector: PointVector{ y: 0.5; yVariation: 0.25; xVariation: 0.25; } + yVector: PointDirection{ y: 0.5; yVariation: 0.25; xVariation: 0.25; } } Timer{ running: true @@ -79,38 +79,38 @@ Rectangle{ interval: 8400 onTriggered: emitC.emitting = true; } - TrailEmitter{ + Emitter{ id: emitA x: 0 y: 120 system: sys emitting: false particle: "goingRight" - speed: PointVector{ x: 100 } + speed: PointDirection{ x: 100 } particleDuration: 4000 particlesPerSecond: 2 particleSize: 32 } - TrailEmitter{ + Emitter{ id: emitB x: 400 y: 240 system: sys emitting: false particle: "goingLeft" - speed: PointVector{ x: -100 } + speed: PointDirection{ x: -100 } particleDuration: 4000 particlesPerSecond: 2 particleSize: 32 } - TrailEmitter{ + Emitter{ id: emitC x: 0 y: 360 system: sys emitting: false particle: "goingDown" - speed: PointVector{ x: 100 } + speed: PointDirection{ x: 100 } particleDuration: 4000 particlesPerSecond: 2 particleSize: 32 diff --git a/examples/declarative/particles/allsmiles/spriteparticles.qml b/examples/declarative/particles/allsmiles/spriteparticles.qml index 4bcb708..1f385f2 100644 --- a/examples/declarative/particles/allsmiles/spriteparticles.qml +++ b/examples/declarative/particles/allsmiles/spriteparticles.qml @@ -39,13 +39,13 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "goldenrod" width: 400 height: 400 - ColoredParticle{ + ImageParticle{ id: test particles: ["Test"] image: "content/particle.png" @@ -55,23 +55,23 @@ Rectangle{ color: "#336666CC" colorVariation: 0.0 } - SpriteParticle{ + ImageParticle{ id: single particles: ["Face"] system: sys z: 2 anchors.fill: parent - Sprite{ + sprites: Sprite{ source: "content/squarefacesprite.png" frames: 6 duration: 120 } } - Mask{ + MaskShape{ id: mask source: "content/smileMask.png" } - TrailEmitter{ + Emitter{ system: sys particle: "Test" anchors.fill: parent @@ -82,7 +82,7 @@ Rectangle{ particleSize: 10 shape: mask } - TrailEmitter{ + Emitter{ system: sys particle: "Face" anchors.fill: parent @@ -90,7 +90,7 @@ Rectangle{ particlesPerSecond: 60 particleDuration: 1440 emitting: true - speed: PointVector{xVariation: 10; yVariation: 10;} + speed: PointDirection{xVariation: 10; yVariation: 10;} particleSize: 30 particleSizeVariation: 10 shape: mask diff --git a/examples/declarative/particles/allsmiles/spritestateparticles.qml b/examples/declarative/particles/allsmiles/spritestateparticles.qml index 6a61487..0818686 100644 --- a/examples/declarative/particles/allsmiles/spritestateparticles.qml +++ b/examples/declarative/particles/allsmiles/spritestateparticles.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "goldenrod" @@ -109,7 +109,7 @@ Rectangle{ z:4 } ParticleSystem{ id: sys } - SpriteParticle{ + ImageParticle{ anchors.fill: parent id: particles system: sys @@ -168,13 +168,13 @@ Rectangle{ duration: 10000 }] } - TrailEmitter{ + Emitter{ system: sys particlesPerSecond: 16 particleDuration: 10000 emitting: true - speed: AngleVector{angle: 90; magnitude: 60; angleVariation: 5} - acceleration: PointVector{ y: 10 } + speed: AngledDirection{angle: 90; magnitude: 60; angleVariation: 5} + acceleration: PointDirection{ y: 10 } particleSize: 30 particleSizeVariation: 10 width: parent.width diff --git a/examples/declarative/particles/allsmiles/spritevariedparticles.qml b/examples/declarative/particles/allsmiles/spritevariedparticles.qml index c1b7730..e6aeacc 100644 --- a/examples/declarative/particles/allsmiles/spritevariedparticles.qml +++ b/examples/declarative/particles/allsmiles/spritevariedparticles.qml @@ -39,14 +39,14 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "goldenrod" width: 800 height: 800 ParticleSystem{ id: sys } - SpriteParticle{ + ImageParticle{ system: sys anchors.fill: parent sprites: [Sprite{ @@ -92,15 +92,15 @@ Rectangle{ duration: 120 }] } - TrailEmitter{ + Emitter{ id: particleEmitter system: sys width: parent.width particlesPerSecond: 16 particleDuration: 8000 emitting: true - speed: AngleVector{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5} - acceleration: PointVector{ y: 10 } + speed: AngledDirection{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5} + acceleration: PointDirection{ y: 10 } particleSize: 30 particleSizeVariation: 10 } diff --git a/examples/declarative/particles/allsmiles/ultraparticles.qml b/examples/declarative/particles/allsmiles/ultraparticles.qml index 85bbdba..f2b6f8d 100644 --- a/examples/declarative/particles/allsmiles/ultraparticles.qml +++ b/examples/declarative/particles/allsmiles/ultraparticles.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "white" @@ -48,7 +48,7 @@ Rectangle{ ParticleSystem{ id: sys } - UltraParticle{ + ImageParticle{ sprites: [ Sprite{ name: "licking" @@ -80,14 +80,14 @@ Rectangle{ factor: 0.1 system: sys } - TrailEmitter{ + Emitter{ system: sys anchors.centerIn: parent id: particles particlesPerSecond: 200 particleDuration: 6000 emitting: true - speed: AngleVector{angleVariation: 360; magnitude: 80; magnitudeVariation: 40} + speed: AngledDirection{angleVariation: 360; magnitude: 80; magnitudeVariation: 40} particleSize: 40 particleEndSize: 80 } diff --git a/examples/declarative/particles/asteroid/asteroid.qml b/examples/declarative/particles/asteroid/asteroid.qml index b5b4f67..223ea81 100644 --- a/examples/declarative/particles/asteroid/asteroid.qml +++ b/examples/declarative/particles/asteroid/asteroid.qml @@ -38,8 +38,8 @@ ** ****************************************************************************/ -import Qt.labs.particles 2.0 -import Qt.labs.particles 2.0 as Qlp +import QtQuick.Particles 2.0 +import QtQuick.Particles 2.0 as Qlp import QtQuick 2.0 Item { @@ -65,14 +65,14 @@ Item { } } - ColoredParticle { + ImageParticle { system: sys particles: ["starfield"] image: "content/star.png" colorVariation: 0.3 color: "white" } - TrailEmitter { + Emitter { id: starField system: sys particle: "starfield" @@ -82,25 +82,25 @@ Item { anchors.centerIn: parent - //acceleration: AngleVector{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed? - acceleration: PointVector{ xVariation: 200; yVariation: 200; } + //acceleration: AngledDirection{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed? + acceleration: PointDirection{ xVariation: 200; yVariation: 200; } particleSize: 0 particleEndSize: 80 particleSizeVariation: 10 } - TrailEmitter{ + Emitter{ system: sys particle: "meteor" particlesPerSecond: 12 particleDuration: 5000 emitting: true - acceleration: PointVector{ xVariation: 80; yVariation: 80; } + acceleration: PointDirection{ xVariation: 80; yVariation: 80; } particleSize: 15 particleEndSize: 300 anchors.centerIn: parent } - SpriteParticle{ + ImageParticle{ system: sys particles: ["meteor"] sprites:[Sprite{ @@ -168,7 +168,7 @@ Item { } } - ColoredParticle{ + ImageParticle{ z:0 system: sys particles: ["exhaust"] @@ -191,7 +191,7 @@ Item { colorVariation: 0.2 } - TrailEmitter{ + Emitter{ id: trailsNormal2 system: sys particle: "exhaust" @@ -202,10 +202,10 @@ Item { y: holder.y x: holder.x - speed: PointVector{ xVariation: 40; yVariation: 40; } + speed: PointDirection{ xVariation: 40; yVariation: 40; } speedFromMovement: 16 - acceleration: PointVector{ xVariation: 10; yVariation: 10; } + acceleration: PointDirection{ xVariation: 10; yVariation: 10; } particleSize: 4 particleSizeVariation: 4 diff --git a/examples/declarative/particles/asteroid/blackhole.qml b/examples/declarative/particles/asteroid/blackhole.qml index 68d5835..f2c9d0a 100644 --- a/examples/declarative/particles/asteroid/blackhole.qml +++ b/examples/declarative/particles/asteroid/blackhole.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ id: root @@ -65,7 +65,7 @@ Rectangle{ } } - TrailEmitter{ + Emitter{ particle: "stars" system: particles particlesPerSecond: 40 @@ -73,10 +73,10 @@ Rectangle{ emitting: true particleSize: 30 particleSizeVariation: 10 - speed: PointVector{ x: 220; xVariation: 40 } + speed: PointDirection{ x: 220; xVariation: 40 } height: parent.height } - TrailEmitter{ + Emitter{ particle: "roids" system: particles particlesPerSecond: 10 @@ -84,14 +84,14 @@ Rectangle{ emitting: true particleSize: 30 particleSizeVariation: 10 - speed: PointVector{ x: 220; xVariation: 40 } + speed: PointDirection{ x: 220; xVariation: 40 } height: parent.height } ParticleSystem{ id: particles anchors.fill: parent } - ColoredParticle{ + ImageParticle{ id: stars particles: ["stars"] system: particles @@ -99,7 +99,7 @@ Rectangle{ color: "white" colorVariation: 0.1 } - SpriteParticle{ + ImageParticle{ id: roids particles: ["roids"] system: particles @@ -112,7 +112,7 @@ Rectangle{ speedModifiesDuration: -0.1 } } - ColoredParticle{ + ImageParticle{ id: shot particles: ["shot"] system: particles @@ -121,7 +121,7 @@ Rectangle{ color: "#0FF06600" colorVariation: 0.3 } - ColoredParticle{ + ImageParticle{ id: engine particles: ["engine"] system: particles @@ -166,7 +166,7 @@ Rectangle{ drag.axis: Drag.XandYAxis drag.target: ship } - TrailEmitter{ + Emitter{ particle: "engine" system: particles particlesPerSecond: 200 @@ -175,18 +175,18 @@ Rectangle{ particleSize: 10 particleEndSize: 4 particleSizeVariation: 4 - speed: PointVector{ x: -128; xVariation: 32 } + speed: PointDirection{ x: -128; xVariation: 32 } height: parent.height width: 20 } - TrailEmitter{ + Emitter{ particle: "shot" system: particles particlesPerSecond: 32 particleDuration: 2000 emitting: spacePressed particleSize: 40 - speed: PointVector{ x: 256; } + speed: PointDirection{ x: 256; } x: parent.width y: parent.height/2 } diff --git a/examples/declarative/particles/custom/blurparticles.qml b/examples/declarative/particles/custom/blurparticles.qml new file mode 100644 index 0000000..7d0f9cc --- /dev/null +++ b/examples/declarative/particles/custom/blurparticles.qml @@ -0,0 +1,125 @@ +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Rectangle{ + color: "white" + width: 240 + height: 360 + ParticleSystem{ + id: sys + } + Emitter{ + system:sys + height: parent.height + particlesPerSecond: 1 + particleDuration: 12000 + speed: PointDirection{x:20;} + particleSize: 64 + } + ShaderEffectSource{ + id: theSource + sourceItem: theItem + hideSource: true + } + Image{ + id: theItem + source: "content/smile.png" + } + + CustomParticle{ + system: sys + //TODO: Someway that you don't have to rewrite the basics for a simple addition + vertexShader:" + attribute highp vec2 vPos; + attribute highp vec2 vTex; + attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize + attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration + attribute highp float r; + + uniform highp mat4 qt_ModelViewProjectionMatrix; + uniform highp float timestamp; + uniform lowp float qt_Opacity; + + varying highp vec2 fTex; + varying lowp float fFade; + varying lowp float fBlur; + + void main() { + fTex = vTex; + highp float size = vData.z; + highp float endSize = vData.w; + + highp float t = (timestamp - vData.x) / vData.y; + + highp float currentSize = mix(size, endSize, t * t); + + if (t < 0. || t > 1.) + currentSize = 0.; + + highp vec2 pos = vPos + - currentSize / 2. + currentSize * vTex // adjust size + + vVec.xy * t * vData.y // apply speed vector.. + + 0.5 * vVec.zw * pow(t * vData.y, 2.); + + gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1); + + highp float fadeIn = min(t * 10., 1.); + highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.)); + + fFade = fadeIn * fadeOut * qt_Opacity; + fBlur = max(0.2 * t, t * r); + } + " + property variant source: theSource + property variant blurred: ShaderEffectSource { + smooth: true + sourceItem: ShaderEffectItem { + width: theItem.width + height: theItem.height + property variant delta: Qt.size(0.0, 1.0 / height) + property variant source: ShaderEffectSource { + smooth: true + sourceItem: ShaderEffectItem { + width: theItem.width + height: theItem.height + property variant delta: Qt.size(1.0 / width, 0.0) + property variant source: theSource + fragmentShader: " + uniform sampler2D source; + uniform highp vec2 delta; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta) + + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta) + + 0.2466 * texture2D(source, qt_TexCoord0) + + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta) + + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta); + }" + } + } + fragmentShader: " + uniform sampler2D source; + uniform highp vec2 delta; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta) + + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta) + + 0.2466 * texture2D(source, qt_TexCoord0) + + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta) + + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta); + }" + } + } + fragmentShader: " + uniform sampler2D source; + uniform sampler2D blurred; + varying highp vec2 fTex; + varying highp float fBlur; + varying highp float fFade; + void main() { + gl_FragColor = mix(texture2D(source, fTex), texture2D(blurred, fTex), min(1.0,fBlur*3.0)) * fFade; + }" + + } +} + diff --git a/examples/declarative/particles/custom/content/smile.png b/examples/declarative/particles/custom/content/smile.png new file mode 100644 index 0000000000000000000000000000000000000000..3d66d725781730c7a9376a25113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I+cdgkcvQ5bu3rMh}M?{9}9g z_g0AA7`4q_^}`$Pq!3Xh&bg&w#&0kowfX$7Zw-+qvp14AQ*!Xc<59lYwh~0rq9TLz(iF2SGziyUC~XwA SNxgs4ATkn);&q}%LH`e8$k9yz literal 0 HcmV?d00001 diff --git a/examples/declarative/particles/modelparticles/bubbles.qml b/examples/declarative/particles/modelparticles/bubbles.qml index 80d03a9..d0eb3ea 100644 --- a/examples/declarative/particles/modelparticles/bubbles.qml +++ b/examples/declarative/particles/modelparticles/bubbles.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "../../modelviews/listview/content" as OtherDemo import "content/script.js" as Script import "content" @@ -56,21 +56,22 @@ Item{ ParticleSystem{ id: sys; } - TrailEmitter{ + Emitter{ system: sys particle: "A" width: parent.width/2 x: parent.width/4 y:parent.height - speed: PointVector{ y: -64; yVariation: 16 } + speed: PointDirection{ y: -64; yVariation: 16 } particlesPerSecond: 1 particleDuration: 8000 } - Drift{ + Wander{ system: sys - xDrift: 200 + xVariance: 400 + pace: 200 } - DataParticle{ + ModelParticle{ id: mp z: 0 system: sys diff --git a/examples/declarative/particles/modelparticles/gridsplosion.qml b/examples/declarative/particles/modelparticles/gridsplosion.qml index d45ef39..fe2dd26 100644 --- a/examples/declarative/particles/modelparticles/gridsplosion.qml +++ b/examples/declarative/particles/modelparticles/gridsplosion.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "content" Item{ @@ -48,13 +48,14 @@ Item{ height: 240 property bool inGrid: false ParticleSystem{ id: sys } - TrailEmitter{ + Emitter{ system: sys id: burster; emitting: false particlesPerSecond: 1000 - particleDuration: 500 - speed: PointVector{xVariation: 400; yVariation: 400} + particleDuration: 50000 + maxParticles: 100; + speed: PointDirection{xVariation: 400; yVariation: 400} anchors.centerIn: parent Timer{ interval: 1000 @@ -69,7 +70,7 @@ Item{ onTriggered: {inGrid = true;}// sys.running = false;} } } - ColoredParticle{ + ImageParticle{ system: sys image: "../trails/content/particle.png" color: "black" @@ -80,17 +81,14 @@ Item{ width: 120 height: 120 } - DataParticle{ + ModelParticle{ system: sys model: theModel.parts.particles + fade: false } Friction{ system: sys - factor: 1 - } - Stasis{ - system: sys - targetLife: 400 + factor: 5 } VisualDataModel{ id: theModel diff --git a/examples/declarative/particles/modelparticles/package.qml b/examples/declarative/particles/modelparticles/package.qml index d5c104b..6487380 100644 --- a/examples/declarative/particles/modelparticles/package.qml +++ b/examples/declarative/particles/modelparticles/package.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "content" Rectangle { @@ -69,7 +69,7 @@ Rectangle { width: 200; height:200 model: visualModel.parts.list } - DataParticle{ + ModelParticle{ x: 200; width: 200; height:200 model: visualModel.parts.grid system: sys @@ -80,11 +80,11 @@ Rectangle { id: sys anchors.fill: parent } - TrailEmitter{ + Emitter{ system: sys width: 100 x: 50 - speed: PointVector{ y: 40 } + speed: PointDirection{ y: 40 } particleDuration: 5000 particlesPerSecond: 1.6 } diff --git a/examples/declarative/particles/modelparticles/stream.qml b/examples/declarative/particles/modelparticles/stream.qml index 0ad807b..73107ad 100644 --- a/examples/declarative/particles/modelparticles/stream.qml +++ b/examples/declarative/particles/modelparticles/stream.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "content/script.js" as Script import "content" @@ -68,13 +68,13 @@ Item{ overwrite: false startTime: 12000//Doesn't actually work with the loading time though... } - TrailEmitter{ + Emitter{ id: emitter system: sys height: parent.height - 132/2 x: -132/2 y: 132/2 - speed: PointVector{ x: 32; xVariation: 8 } + speed: PointDirection{ x: 32; xVariation: 8 } particlesPerSecond: 0.5 particleDuration: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first) particle: "photos" @@ -85,7 +85,7 @@ Item{ height: parent.height width: 1000 } - ColoredParticle{ + ImageParticle{ system: sys particles: ["fireworks"] image: "../trails/content/star.png" @@ -125,7 +125,7 @@ Item{ } property Item alertItem; function alert(){ - resetter.active = false + //resetter.active = false force.active = true; alertItem = alertDelegate.createObject(root); alertItem.x = root.width/2 - alertItem.width/2 @@ -142,31 +142,27 @@ Item{ interval: 800 onTriggered: { force.active = false - resetter.active = true; + //resetter.active = true; mp.take(alertItem, true); centerEmitter.burst(1); } } - Attractor{ + PointAttractor{ id: force system: sys x: root.width/2 y: root.height/2 - strength: -30000 + strength: -10000 active: false anchors.centerIn: parent width: parent.width/2 height: parent.height/2 particles:["photos"] + physics: PointAttractor.Position } - Reset{ - id: resetter - system: sys - particles:["photos"] - } - TrailEmitter{ + Emitter{ id: centerEmitter - speed: PointVector{ x: 32; xVariation: 8;} + speed: PointDirection{ x: 32; xVariation: 8;} particlesPerSecond: 0.5 particleDuration: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first) maxParticles: 20 @@ -177,7 +173,7 @@ Item{ //TODO: Zoom in effect } - TrailEmitter{ + Emitter{ id: spawnFireworks particle: "fireworks" system: sys @@ -191,8 +187,8 @@ Item{ emitting: false particleSize: 32 particleEndSize: 8 - speed: AngleVector{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 } - acceleration: PointVector{ y: 160 } + speed: AngledDirection{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 } + acceleration: PointDirection{ y: 160 } } Item{ x: -1000; y: -1000 //offscreen Repeater{//Load them here, add to system on completed diff --git a/examples/declarative/particles/snow/content/Button.qml b/examples/declarative/particles/snow/content/Button.qml new file mode 100644 index 0000000..a937b3b --- /dev/null +++ b/examples/declarative/particles/snow/content/Button.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: container + + property string text: "Button" + signal clicked + + width: buttonLabel.width + 20; height: buttonLabel.height + 20 + smooth: true + property color myCol: "#999999" + border { width: 1; color: Qt.darker(myCol) } + radius: 8 + + gradient: Gradient { + GradientStop { + position: 0.0 + color: { + if (mouseArea.pressed) + return Qt.darker(myCol) + else + return Qt.lighter(myCol) + } + } + GradientStop { position: 1.0; color: myCol } + } + + MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + + Text { + id: buttonLabel; text: container.text; anchors.centerIn: container; color: "black"; font.pixelSize: 24 + } +} diff --git a/examples/declarative/particles/snow/snow.qml b/examples/declarative/particles/snow/snow.qml index 25d2e14..2be2438 100644 --- a/examples/declarative/particles/snow/snow.qml +++ b/examples/declarative/particles/snow/snow.qml @@ -39,15 +39,16 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 +import "content" Rectangle{ width: 360 height: 540 ParticleSystem { id: particles } - SpriteParticle { + ImageParticle { system: particles - Sprite{ + sprites: Sprite{ name: "snow" source: "content/flake-01.png" frames: 51 @@ -55,21 +56,38 @@ Rectangle{ } } Wander { + id: wanderer system: particles anchors.fill: parent - xVariance: 40; - pace: 40; + xVariance: 360/(wanderer.physics+1); + pace: 100*(wanderer.physics+1); } - TrailEmitter { + Emitter { system: particles particlesPerSecond: 20 particleDuration: 7000 emitting: true - speed: PointVector{ y:80; yVariation: 40; } - acceleration: PointVector{ y: 4 } + speed: PointDirection{ y:80; yVariation: 40; } + acceleration: PointDirection{ y: 4 } particleSize: 20 particleSizeVariation: 10 width: parent.width height: 100 } + Row{ + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + Button{ + text:"dx/dt" + onClicked: wanderer.physics = Wander.Position; + } + Button{ + text:"dv/dt" + onClicked: wanderer.physics = Wander.Velocity; + } + Button{ + text:"da/dt" + onClicked: wanderer.physics = Wander.Acceleration; + } + } } diff --git a/examples/declarative/particles/snow/snow2.qml b/examples/declarative/particles/snow/snow2.qml deleted file mode 100644 index c016ba2..0000000 --- a/examples/declarative/particles/snow/snow2.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt.labs.particles 2.0 - -Rectangle{ - width: 360 - height: 540 - ParticleSystem{ id: particles } - SpriteParticle{ - system: particles - Sprite{ - name: "snow" - source: "content/flake-01.png" - frames: 51 - duration: 40 - } - } - Drift{ - system: particles - anchors.fill: parent - xDrift: 400; - } - TrailEmitter{ - system: particles - particlesPerSecond: 20 - particleDuration: 7000 - emitting: true - speed: PointVector{ y:80; yVariation: 40; } - acceleration: PointVector{ y: 4 } - particleSize: 20 - particleSizeVariation: 10 - width: parent.width - height: 100 - } -} diff --git a/examples/declarative/particles/snow/snow3.qml b/examples/declarative/particles/snow/snow3.qml deleted file mode 100644 index 080bc4d..0000000 --- a/examples/declarative/particles/snow/snow3.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt.labs.particles 2.0 - -Rectangle{ - width: 360 - height: 540 - id: root - ParticleSystem{ id: particles } - SpriteParticle{ - system: particles - sprites: Sprite{ - name: "snow" - source: "content/flake-01.png" - frames: 51 - duration: 40 - } - } - Drift{ - system: particles - anchors.fill: parent - xDrift: 200 - } - SpeedLimit{ - system: particles - anchors.fill: parent - speedLimit: 100 - } - TrailEmitter{ - system: particles - particlesPerSecond: 20 - particleDuration: 7000 - emitting: true - speed: PointVector{ y:80; yVariation: 40; } - acceleration: PointVector{ y: 4 } - particleSize: 20 - particleSizeVariation: 10 - width: parent.width - height: 40 - } -} diff --git a/examples/declarative/particles/spaceexplorer/spaceexplorer.qml b/examples/declarative/particles/spaceexplorer/spaceexplorer.qml index 091ca0a..f303bb4 100644 --- a/examples/declarative/particles/spaceexplorer/spaceexplorer.qml +++ b/examples/declarative/particles/spaceexplorer/spaceexplorer.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "content/helpers.js" as Helpers Rectangle{ @@ -75,7 +75,7 @@ Rectangle{ property bool fakeMoving: false property real fakeMovementDir: 0 - TrailEmitter{ + Emitter{ particle: "stars2" system: background particlesPerSecond: 60 @@ -86,7 +86,7 @@ Rectangle{ anchors.fill: parent } ParticleSystem{ id: background } - ColoredParticle{ + ImageParticle{ particles: ["stars2"] system: background anchors.fill: parent @@ -197,7 +197,7 @@ Rectangle{ ParticleSystem{ id: foreground } - ColoredParticle{ + ImageParticle{ particles: ["stars"] anchors.fill: parent system: foreground @@ -205,7 +205,7 @@ Rectangle{ color: "white" colorVariation: 0.1 } - ColoredParticle{ + ImageParticle{ particles: ["shot"] anchors.fill: parent system: foreground @@ -214,7 +214,7 @@ Rectangle{ color: "orange" colorVariation: 0.3 } - ColoredParticle{ + ImageParticle{ id: engine particles: ["engine"] anchors.fill: parent @@ -238,30 +238,31 @@ Rectangle{ colorVariation: 0.2 } - SpriteParticle{ + ImageParticle{ particles: ["powerups"] anchors.fill: parent system: foreground - Sprite{ + sprites:[Sprite{ name: "norm" source: "content/powerupScore.png" frames: 35 duration: 40 to: {"norm":1, "got":0} - } + }, Sprite{ name: "got" source: "content/powerupScore_got.png" frames: 22 duration: 40 to: {"null":1} - } + }, Sprite{ name: "null" source: "content/powerupScore_gone.png" frames: 1 duration: 1000 } + ] } SpriteGoal{ x: rocket.x - 30 @@ -273,8 +274,9 @@ Rectangle{ onAffected: if(!gameOver) score += 1000 system: foreground } - GravitationalSingularity{ + PointAttractor{ id: gs1; x: vorteX; y: vorteY; strength: 800000; + proportionalToDistance: PointAttractor.Quadratic; system: foreground } Kill{ @@ -285,8 +287,9 @@ Rectangle{ system: foreground } - GravitationalSingularity{ + PointAttractor{ id: gs2; x: vorteX2; y: vorteY2; strength: 800000; + proportionalToDistance: PointAttractor.Quadratic; system: foreground } Kill{ @@ -297,8 +300,9 @@ Rectangle{ system: foreground } - GravitationalSingularity{ + PointAttractor{ id: gs3; x: vorteX3; y: vorteY3; strength: 800000; + proportionalToDistance: PointAttractor.Quadratic; system: foreground } Kill{ @@ -308,8 +312,9 @@ Rectangle{ height: holeSize * 2 system: foreground } - GravitationalSingularity{ + PointAttractor{ id: gs4; x: vorteX4; y: vorteY4; strength: 800000; + proportionalToDistance: PointAttractor.Quadratic; system: foreground } Kill{ @@ -319,7 +324,7 @@ Rectangle{ height: holeSize * 2 system: foreground } - TrailEmitter{ + Emitter{ particle: "powerups" system: foreground particlesPerSecond: 1 @@ -329,7 +334,7 @@ Rectangle{ particleSizeVariation: 10 anchors.fill: parent } - TrailEmitter{ + Emitter{ particle: "stars" system: foreground particlesPerSecond: 40 @@ -374,7 +379,7 @@ Rectangle{ drag.axis: Drag.XandYAxis drag.target: rocket }, - TrailEmitter{ + Emitter{ system: foreground particle: "engine" particlesPerSecond: 100 @@ -383,7 +388,7 @@ Rectangle{ particleSize: 10 particleEndSize: 4 particleSizeVariation: 4 - speed: PointVector{ + speed: PointDirection{ x: -128 * Math.cos(rocket.rotation * (Math.PI / 180)) y: -128 * Math.sin(rocket.rotation * (Math.PI / 180)) } @@ -392,14 +397,14 @@ Rectangle{ width: 4 }, - TrailEmitter{ + Emitter{ system: foreground particle: "shot" particlesPerSecond: 16 particleDuration: 1600 emitting: !gameOver && shoot particleSize: 40 - speed: PointVector{ + speed: PointDirection{ x: 256 * Math.cos(rocket.rotation * (Math.PI / 180)) y: 256 * Math.sin(rocket.rotation * (Math.PI / 180)) } diff --git a/examples/declarative/particles/trails/dynamicemitters.qml b/examples/declarative/particles/trails/dynamicemitters.qml index 8ea0272..8e55503 100644 --- a/examples/declarative/particles/trails/dynamicemitters.qml +++ b/examples/declarative/particles/trails/dynamicemitters.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ id: root @@ -49,7 +49,7 @@ Rectangle{ ParticleSystem{ id: sys } - ColoredParticle{ + ImageParticle{ system: sys image: "content/particle.png" color: "white" @@ -58,9 +58,9 @@ Rectangle{ } Component{ id: emitterComp - TrailEmitter{ + Emitter{ id: container - TrailEmitter{ + Emitter{ id: emitMore system: sys emitting: true @@ -68,7 +68,7 @@ Rectangle{ particleDuration: 600 particleSize: 16 particleEndSize: 8 - speed: AngleVector{angleVariation:360; magnitude: 60} + speed: AngledDirection{angleVariation:360; magnitude: 60} } property int life: 2600 diff --git a/examples/declarative/particles/trails/fireballs.qml b/examples/declarative/particles/trails/fireballs.qml index 116a233..cd81168 100644 --- a/examples/declarative/particles/trails/fireballs.qml +++ b/examples/declarative/particles/trails/fireballs.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle { id: root @@ -52,7 +52,7 @@ Rectangle { } /* - ColoredParticle{ + ImageParticle{ id: fireball anchors.fill: parent particles: ["E"] @@ -62,7 +62,7 @@ Rectangle { color: "#00ff400f" } */ - ColoredParticle{ + ImageParticle{ id: smoke system: particles anchors.fill: parent @@ -71,7 +71,7 @@ Rectangle { colorVariation: 0 color: "#00111111" } - ColoredParticle{ + ImageParticle{ id: flame anchors.fill: parent system: particles @@ -80,7 +80,7 @@ Rectangle { colorVariation: 0.1 color: "#00ff400f" } - TrailEmitter{ + Emitter{ id: fire system: particles particle: "C" @@ -91,8 +91,8 @@ Rectangle { particlesPerSecond: 350 particleDuration: 3500 - acceleration: PointVector{ y: -17; xVariation: 3 } - speed: PointVector{xVariation: 3} + acceleration: PointDirection{ y: -17; xVariation: 3 } + speed: PointDirection{xVariation: 3} particleSize: 24 particleSizeVariation: 8 @@ -109,8 +109,8 @@ Rectangle { particlesPerParticlePerSecond: 1 particleDuration: 2000 - speed: PointVector{y:-17*6; yVariation: -17; xVariation: 3} - acceleration: PointVector{xVariation: 3} + speed: PointDirection{y:-17*6; yVariation: -17; xVariation: 3} + acceleration: PointDirection{xVariation: 3} particleSize: 36 particleSizeVariation: 8 @@ -145,14 +145,14 @@ Rectangle { emissionWidth: 16 emissionHeight: 16 - speed: PointVector{yVariation: 16; xVariation: 16} - acceleration: PointVector{y: -16} + speed: PointDirection{yVariation: 16; xVariation: 16} + acceleration: PointDirection{y: -16} particleSize: 24 particleSizeVariation: 8 particleEndSize: 8 } - TrailEmitter{ + Emitter{ id: balls system: particles particle: "E" @@ -163,8 +163,8 @@ Rectangle { particlesPerSecond: 2 particleDuration: 7000 - speed: PointVector{y:-17*4*2; xVariation: 6*6} - acceleration: PointVector{y: 17*2; xVariation: 6*6} + speed: PointDirection{y:-17*4*2; xVariation: 6*6} + acceleration: PointDirection{y: 17*2; xVariation: 6*6} particleSize: 12 particleSizeVariation: 4 diff --git a/examples/declarative/particles/trails/layered.qml b/examples/declarative/particles/trails/layered.qml index 38eb8e6..b2895dd 100644 --- a/examples/declarative/particles/trails/layered.qml +++ b/examples/declarative/particles/trails/layered.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ id: root @@ -55,30 +55,26 @@ Rectangle{ id: sys startTime: 4000 } - TrailEmitter{ + Emitter{ system: sys y:root.height + 20 width: root.width particlesPerSecond: 200 particleDuration: 4000 - speed: PointVector{ y: -120; } + speed: PointDirection{ y: -120; } } - SpriteParticle{ + ImageParticle{ system: sys visible: !cloneMode - Sprite{ - source: "content/particle2.png" - } + image: "content/particle2.png" } - SpriteParticle{ + ImageParticle{ system: sys visible: cloneMode z: 0 - Sprite{ - source: "content/particle3.png" - } + image: "content/particle3.png" } - SpriteParticle{ + ImageParticle{ system: sys clip: true visible: cloneMode @@ -86,8 +82,6 @@ Rectangle{ height: 240 width: root.width z: 1 - Sprite{ - source: "content/particle.png" - } + image: "content/particle.png" } } diff --git a/examples/declarative/particles/trails/list.qml b/examples/declarative/particles/trails/list.qml index 2ab579f..7874590 100644 --- a/examples/declarative/particles/trails/list.qml +++ b/examples/declarative/particles/trails/list.qml @@ -43,14 +43,14 @@ // highlight bar is moved between items. + Particles. import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import "content" Rectangle { width: 200; height: 300 color: "black" ParticleSystem{ id: particles } - ColoredParticle{ + ImageParticle{ anchors.fill: parent system: particles z: 10 @@ -92,7 +92,7 @@ Rectangle { y: listView.currentItem.y; //Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } } Behavior on y { NumberAnimation {id: anim} } - TrailEmitter{ + Emitter{ anchors.fill: parent system: particles; emitting: anim.running diff --git a/examples/declarative/particles/trails/overburst.qml b/examples/declarative/particles/trails/overburst.qml index 6ca1597..ed9313d 100644 --- a/examples/declarative/particles/trails/overburst.qml +++ b/examples/declarative/particles/trails/overburst.qml @@ -39,21 +39,21 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "black" width: 360 height: 540 ParticleSystem{ id: sys } - ColoredParticle{ + ImageParticle{ system: sys id: cp image: "content/particle.png" colorVariation: 0.4 color: "#000000FF" } - TrailEmitter{ + Emitter{ //burst on click id: bursty system: sys @@ -63,7 +63,7 @@ Rectangle{ particlesPerSecond: 16000 particleDuration: 1000 maxParticles: 4000 - acceleration: AngleVector{angleVariation: 360; magnitude: 360; } + acceleration: AngledDirection{angleVariation: 360; magnitude: 360; } particleSize: 8 particleEndSize: 16 particleSizeVariation: 4 diff --git a/examples/declarative/particles/trails/portal.qml b/examples/declarative/particles/trails/portal.qml index dba2e59..ae9b447 100644 --- a/examples/declarative/particles/trails/portal.qml +++ b/examples/declarative/particles/trails/portal.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ id: root @@ -54,7 +54,7 @@ Rectangle{ id: particles startTime: 2000 } - ColoredParticle{ + ImageParticle{ particles: ["center","edge"] anchors.fill: parent system: particles @@ -62,7 +62,7 @@ Rectangle{ colorVariation: 0.1 color: "#009999FF" } - TrailEmitter{ + Emitter{ anchors.fill: parent particle: "center" system: particles @@ -72,15 +72,15 @@ Rectangle{ particleSize: 20 particleSizeVariation: 2 particleEndSize: 0 - shape: Ellipse{fill: false} - speed: DirectedVector{ + shape: EllipseShape{fill: false} + speed: TargetedDirection{ targetX: root.width/2 targetY: root.height/2 proportionalMagnitude: true magnitude: 0.5 } } - TrailEmitter{ + Emitter{ anchors.fill: parent particle: "edge" system: particles @@ -90,15 +90,15 @@ Rectangle{ particleSize: 20 particleSizeVariation: 2 particleEndSize: 0 - shape: Ellipse{fill: false} - speed: DirectedVector{ + shape: EllipseShape{fill: false} + speed: TargetedDirection{ targetX: root.width/2 targetY: root.height/2 proportionalMagnitude: true magnitude: 0.1 magnitudeVariation: 0.1 } - acceleration: DirectedVector{ + acceleration: TargetedDirection{ targetX: root.width/2 targetY: root.height/2 targetVariation: 200 diff --git a/examples/declarative/particles/trails/rainbow.qml b/examples/declarative/particles/trails/rainbow.qml index 6c64929..543a9b6 100644 --- a/examples/declarative/particles/trails/rainbow.qml +++ b/examples/declarative/particles/trails/rainbow.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 import QtQuick 2.0 Rectangle { @@ -48,7 +48,7 @@ Rectangle { color: "black" ParticleSystem{ id: particles } - ColoredParticle{ + ImageParticle{ system: particles colorVariation: 0.5 alpha: 0 @@ -57,7 +57,7 @@ Rectangle { colorTable: "content/colortable.png" sizeTable: "content/colortable.png" } - TrailEmitter{ + Emitter{ system: particles particlesPerSecond: 500 particleDuration: 2000 @@ -72,8 +72,8 @@ Rectangle { speedFromMovement: 20 - speed: PointVector{ xVariation: 5; yVariation: 5;} - acceleration: PointVector{ xVariation: 5; yVariation: 5;} + speed: PointDirection{ xVariation: 5; yVariation: 5;} + acceleration: PointDirection{ xVariation: 5; yVariation: 5;} particleSize: 16 //particleEndSize: 8 diff --git a/examples/declarative/particles/trails/shimmer.qml b/examples/declarative/particles/trails/shimmer.qml index 06f599d..b3157f6 100644 --- a/examples/declarative/particles/trails/shimmer.qml +++ b/examples/declarative/particles/trails/shimmer.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ width: 360 @@ -53,7 +53,7 @@ Rectangle{ id: particles running: false } - ColoredParticle{ + ImageParticle{ anchors.fill: parent system: particles image: "content/star.png" @@ -61,7 +61,7 @@ Rectangle{ alpha: 0 colorVariation: 0.6 } - TrailEmitter{ + Emitter{ anchors.fill: parent system: particles particlesPerSecond: 2000 diff --git a/examples/declarative/particles/trails/swarm.qml b/examples/declarative/particles/trails/swarm.qml deleted file mode 100644 index 083f9e8..0000000 --- a/examples/declarative/particles/trails/swarm.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt.labs.particles 2.0 as QLP - -Rectangle{ - width: 200 - height: 200 - color: "black" - QLP.ParticleSystem{ id: ps } - QLP.ColoredParticle{ - system: ps - particles: ["star1","star2"] - anchors.fill: parent - clip: true - image: "content/star.png" - } - QLP.Swarm{ - system: ps - leaders: ["star2"]; - anchors.fill: parent - strength: 128 - } - QLP.TrailEmitter{ - anchors.fill: parent - system: ps - particle: "star1" - particlesPerSecond: 100 - particleDuration: 2000 - } - QLP.TrailEmitter{ - anchors.fill: parent - system: ps - particle: "star2" - particlesPerSecond: 0.4 - particleDuration: 10000 - particleSize: 64 - particleEndSize: 32 - } -} diff --git a/examples/declarative/particles/trails/trails.qml b/examples/declarative/particles/trails/trails.qml index 58d369c..6ee8a6e 100644 --- a/examples/declarative/particles/trails/trails.qml +++ b/examples/declarative/particles/trails/trails.qml @@ -39,33 +39,33 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ color: "black" width: 360 height: 540 ParticleSystem{ id: sys } - ColoredParticle{ + ImageParticle{ system: sys id: cp image: "content/particle.png" color: "#00FFFFFF" colorVariation: 0.4 } - TrailEmitter{ + Emitter{ //burst on click id: bursty system: sys emitting: false particlesPerSecond: 2000 particleDuration: 500 - acceleration: AngleVector{ angle: 90; angleVariation: 360; magnitude: 640; } + acceleration: AngledDirection{ angle: 90; angleVariation: 360; magnitude: 640; } particleSize: 8 particleEndSize: 16 particleSizeVariation: 4 } - TrailEmitter{ + Emitter{ system: sys speedFromMovement: 4.0 emitting: ma.pressed @@ -73,7 +73,7 @@ Rectangle{ y: ma.mouseY particlesPerSecond: 400 particleDuration: 2000 - acceleration: AngleVector{ angle: 90; angleVariation: 22; magnitude: 32; } + acceleration: AngledDirection{ angle: 90; angleVariation: 22; magnitude: 32; } particleSize: 8 particleEndSize: 16 particleSizeVariation: 8 diff --git a/examples/declarative/particles/trails/turbulence.qml b/examples/declarative/particles/trails/turbulence.qml index 7da5046..bde25bc 100644 --- a/examples/declarative/particles/trails/turbulence.qml +++ b/examples/declarative/particles/trails/turbulence.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle{ width: 360 @@ -66,21 +66,21 @@ Rectangle{ frequency: 64 gridSize: 16 } - ColoredParticle{ + ImageParticle{ particles: ["smoke"] system: ps image: "content/particle.png" color: "#11111111" colorVariation: 0 } - ColoredParticle{ + ImageParticle{ particles: ["flame"] system: ps image: "content/particle.png" color: "#11ff400f" colorVariation: 0.1 } - TrailEmitter{ + Emitter{ anchors.centerIn: parent system: ps particle: "flame" @@ -90,8 +90,8 @@ Rectangle{ particleSize: 20 particleEndSize: 10 particleSizeVariation: 10 - acceleration: PointVector{ y: -40 } - speed: AngleVector{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 } + acceleration: PointDirection{ y: -40 } + speed: AngledDirection{ angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 } } FollowEmitter{ id: smoke1 @@ -107,8 +107,8 @@ Rectangle{ particleSize: 16 particleEndSize: 8 particleSizeVariation: 8 - acceleration: PointVector{ y: -40 } - speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } + acceleration: PointDirection{ y: -40 } + speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } } FollowEmitter{ id: smoke2 @@ -123,7 +123,7 @@ Rectangle{ particleSize: 36 particleEndSize: 24 particleSizeVariation: 8 - acceleration: PointVector{ y: -40 } - speed: AngleVector{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } + acceleration: PointDirection{ y: -40 } + speed: AngledDirection{ angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } } } diff --git a/examples/declarative/particles/trails/velocityfrommotion.qml b/examples/declarative/particles/trails/velocityfrommotion.qml index 3692410..d2e4ed2 100644 --- a/examples/declarative/particles/trails/velocityfrommotion.qml +++ b/examples/declarative/particles/trails/velocityfrommotion.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 -import Qt.labs.particles 2.0 +import QtQuick.Particles 2.0 Rectangle { @@ -75,7 +75,7 @@ Rectangle { } ParticleSystem{ id: sys1 } - ColoredParticle{ + ImageParticle{ system: sys1 image: "content/particle.png" color: "cyan" @@ -105,7 +105,7 @@ Rectangle { } colorVariation: 0.3 } - TrailEmitter{ + Emitter{ id: trailsNormal system: sys1 @@ -116,15 +116,15 @@ Rectangle { y: mouseArea.pressed ? mouseArea.mouseY : circle.cy x: mouseArea.pressed ? mouseArea.mouseX : circle.cx - speed: PointVector{xVariation: 4; yVariation: 4;} - acceleration: PointVector{xVariation: 10; yVariation: 10;} + speed: PointDirection{xVariation: 4; yVariation: 4;} + acceleration: PointDirection{xVariation: 10; yVariation: 10;} speedFromMovement: 8 particleSize: 8 particleSizeVariation: 4 } ParticleSystem { id: sys2 } - ColoredParticle{ + ImageParticle{ color: "cyan" system: sys2 alpha: 0 @@ -144,7 +144,7 @@ Rectangle { colorVariation: 0.5 image: "content/star.png" } - TrailEmitter{ + Emitter{ id: trailsStars system: sys2 @@ -155,15 +155,15 @@ Rectangle { y: mouseArea.pressed ? mouseArea.mouseY : circle.cy x: mouseArea.pressed ? mouseArea.mouseX : circle.cx - speed: PointVector{xVariation: 4; yVariation: 4;} - acceleration: PointVector{xVariation: 10; yVariation: 10;} + speed: PointDirection{xVariation: 4; yVariation: 4;} + acceleration: PointDirection{xVariation: 10; yVariation: 10;} speedFromMovement: 8 particleSize: 22 particleSizeVariation: 4 } ParticleSystem { id: sys3; } - ColoredParticle{ + ImageParticle{ image: "content/particle.png" system: sys3 color: "orange" @@ -185,7 +185,7 @@ Rectangle { colorVariation: 0.2 } - TrailEmitter{ + Emitter{ id: trailsNormal2 system: sys3 @@ -197,14 +197,14 @@ Rectangle { speedFromMovement: 16 - speed: PointVector{xVariation: 4; yVariation: 4;} - acceleration: PointVector{xVariation: 10; yVariation: 10;} + speed: PointDirection{xVariation: 4; yVariation: 4;} + acceleration: PointDirection{xVariation: 10; yVariation: 10;} particleSize: 12 particleSizeVariation: 4 } ParticleSystem { id: sys4; } - ColoredParticle{ + ImageParticle{ system: sys4 image: "content/star.png" color: "green" @@ -225,7 +225,7 @@ Rectangle { colorVariation: 0.5 } - TrailEmitter{ + Emitter{ id: trailsStars2 system: sys4 @@ -237,8 +237,8 @@ Rectangle { x: mouseArea.pressed ? mouseArea.mouseX : circle2.cx speedFromMovement: 16 - speed: PointVector{xVariation: 2; yVariation: 2;} - acceleration: PointVector{xVariation: 10; yVariation: 10;} + speed: PointDirection{xVariation: 2; yVariation: 2;} + acceleration: PointDirection{xVariation: 10; yVariation: 10;} particleSize: 22 particleSizeVariation: 4 diff --git a/src/declarative/particles/qsgmaskextruder.cpp b/src/declarative/particles/qsgmaskextruder.cpp index 3fe28b3..d9a4639 100644 --- a/src/declarative/particles/qsgmaskextruder.cpp +++ b/src/declarative/particles/qsgmaskextruder.cpp @@ -53,7 +53,7 @@ QSGMaskExtruder::QSGMaskExtruder(QObject *parent) : QPointF QSGMaskExtruder::extrude(const QRectF &r) { ensureInitialized(r); - if(!m_mask.count()) + if(!m_mask.count() || m_img.isNull()) return r.topLeft(); const QPointF p = m_mask[rand() % m_mask.count()]; //### Should random sub-pixel positioning be added? @@ -63,6 +63,8 @@ QPointF QSGMaskExtruder::extrude(const QRectF &r) bool QSGMaskExtruder::contains(const QRectF &bounds, const QPointF &point) { ensureInitialized(bounds);//###Current usage patterns WILL lead to different bounds/r calls. Separate list? + if(m_img.isNull()) + return false; QPoint p = point.toPoint() - bounds.topLeft().toPoint(); return m_img.rect().contains(p) && (bool)m_img.pixelIndex(p); } @@ -70,14 +72,19 @@ bool QSGMaskExtruder::contains(const QRectF &bounds, const QPointF &point) void QSGMaskExtruder::ensureInitialized(const QRectF &r) { if(m_lastWidth == r.width() && m_lastHeight == r.height()) - return; + return;//Same as before m_lastWidth = r.width(); m_lastHeight = r.height(); + m_img = QImage(); m_mask.clear(); if(m_source.isEmpty()) return; m_img = QImage(m_source.toLocalFile()); + if(m_img.isNull()){ + qWarning() << "MaskShape: Cannot load" << qPrintable(m_source.toLocalFile()); + return; + } m_img = m_img.createAlphaMask(); m_img = m_img.convertToFormat(QImage::Format_Mono);//Else LSB, but I think that's easier m_img = m_img.scaled(r.size().toSize());//TODO: Do they need aspect ratio stuff? Or tiling? diff --git a/src/declarative/particles/qsgparticleaffector_p.h b/src/declarative/particles/qsgparticleaffector_p.h index 1572ad8..b299158 100644 --- a/src/declarative/particles/qsgparticleaffector_p.h +++ b/src/declarative/particles/qsgparticleaffector_p.h @@ -52,7 +52,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) - class QSGParticleAffector : public QSGItem { Q_OBJECT diff --git a/src/declarative/particles/qsgpointattractor.cpp b/src/declarative/particles/qsgpointattractor.cpp index 3c3ca33..4c67523 100644 --- a/src/declarative/particles/qsgpointattractor.cpp +++ b/src/declarative/particles/qsgpointattractor.cpp @@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE QSGPointAttractorAffector::QSGPointAttractorAffector(QSGItem *parent) : QSGParticleAffector(parent), m_strength(0.0), m_x(0), m_y(0) + , m_physics(Velocity), m_proportionalToDistance(Linear) { } @@ -52,15 +53,36 @@ bool QSGPointAttractorAffector::affectParticle(QSGParticleData *d, qreal dt) { if(m_strength == 0.0) return false; - qreal dx = m_x - d->curX(); - qreal dy = m_y - d->curY(); + qreal dx = m_y - d->curX(); + qreal dy = m_x - d->curY(); qreal r = sqrt((dx*dx) + (dy*dy)); qreal theta = atan2(dy,dx); - qreal ds = (m_strength / r) * dt; + qreal ds = 0; + switch(m_proportionalToDistance){ + case Quadratic: + ds = (m_strength / qMax(1.,r*r)) * dt; + break; + case Linear://also default + default: + ds = (m_strength / qMax(1.,r)) * dt; + } dx = ds * cos(theta); dy = ds * sin(theta); - d->setInstantaneousSX(d->pv.sx + dx); - d->setInstantaneousSY(d->pv.sy + dy); + switch(m_physics){ + case Position: + d->pv.x = (d->pv.x + dx); + d->pv.y = (d->pv.y + dy); + break; + case Acceleration: + d->setInstantaneousAX(d->pv.ax + dx); + d->setInstantaneousAY(d->pv.ay + dy); + break; + case Velocity: //also default + default: + d->setInstantaneousSX(d->pv.sx + dx); + d->setInstantaneousSY(d->pv.sy + dy); + } + return true; } QT_END_NAMESPACE diff --git a/src/declarative/particles/qsgpointattractor_p.h b/src/declarative/particles/qsgpointattractor_p.h index d4f7159..3ca29df 100644 --- a/src/declarative/particles/qsgpointattractor_p.h +++ b/src/declarative/particles/qsgpointattractor_p.h @@ -57,7 +57,23 @@ class QSGPointAttractorAffector : public QSGParticleAffector Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged) Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) + Q_PROPERTY(PhysicsAffects physics READ physics WRITE setPhysics NOTIFY physicsChanged) + Q_PROPERTY(Proportion proportionalToDistance READ proportionalToDistance WRITE setProportionalToDistance NOTIFY proportionalToDistanceChanged) + Q_ENUMS(PhysicsAffects) + Q_ENUMS(Proportion) + public: + enum Proportion{ + Linear, + Quadratic + }; + + enum PhysicsAffects { + Position, + Velocity, + Acceleration + }; + explicit QSGPointAttractorAffector(QSGItem *parent = 0); qreal strength() const @@ -75,6 +91,16 @@ public: return m_y; } + PhysicsAffects physics() const + { + return m_physics; + } + + Proportion proportionalToDistance() const + { + return m_proportionalToDistance; + } + signals: void strengthChanged(qreal arg); @@ -83,6 +109,10 @@ signals: void yChanged(qreal arg); + void physicsChanged(PhysicsAffects arg); + + void proportionalToDistanceChanged(Proportion arg); + public slots: void setStrength(qreal arg) { @@ -107,12 +137,30 @@ void setY(qreal arg) emit yChanged(arg); } } +void setPhysics(PhysicsAffects arg) +{ + if (m_physics != arg) { + m_physics = arg; + emit physicsChanged(arg); + } +} + +void setProportionalToDistance(Proportion arg) +{ + if (m_proportionalToDistance != arg) { + m_proportionalToDistance = arg; + emit proportionalToDistanceChanged(arg); + } +} + protected: virtual bool affectParticle(QSGParticleData *d, qreal dt); private: qreal m_strength; qreal m_x; qreal m_y; +PhysicsAffects m_physics; +Proportion m_proportionalToDistance; }; QT_END_NAMESPACE diff --git a/src/declarative/particles/qsgwander.cpp b/src/declarative/particles/qsgwander.cpp index e6787f2..6e56d6a 100644 --- a/src/declarative/particles/qsgwander.cpp +++ b/src/declarative/particles/qsgwander.cpp @@ -44,7 +44,8 @@ QT_BEGIN_NAMESPACE QSGWanderAffector::QSGWanderAffector(QSGItem *parent) : - QSGParticleAffector(parent) + QSGParticleAffector(parent), m_xVariance(0), m_yVariance(0), m_pace(0) + , m_physics(Velocity) { m_needsReset = true; } @@ -81,6 +82,7 @@ void QSGWanderAffector::reset(int systemIdx) bool QSGWanderAffector::affectParticle(QSGParticleData* data, qreal dt) { + /*TODO: Add a mode which does basically this - picking a direction, going in it (random speed) 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)) { @@ -106,5 +108,37 @@ bool QSGWanderAffector::affectParticle(QSGParticleData* data, qreal dt) p->y += dy; return true; + */ + qreal dx = dt * m_pace * (2 * qreal(qrand())/RAND_MAX - 1); + qreal dy = dt * m_pace * (2 * qreal(qrand())/RAND_MAX - 1); + qreal newX, newY; + switch(m_physics){ + case Position: + newX = data->curX() + dx; + if(m_xVariance > qAbs(newX) ) + data->pv.x += dx; + newY = data->curY() + dy; + if(m_yVariance > qAbs(newY) ) + data->pv.y += dy; + break; + default: + case Velocity: + newX = data->curSX() + dx; + if(m_xVariance > qAbs(newX) ) + data->setInstantaneousSX(newX); + newY = data->curSY() + dy; + if(m_yVariance > qAbs(newY) ) + data->setInstantaneousSY(newY); + break; + case Acceleration: + newX = data->pv.ax + dx; + if(m_xVariance > qAbs(newX) ) + data->setInstantaneousAX(newX); + newY = data->pv.ay + dy; + if(m_yVariance > qAbs(newY) ) + data->setInstantaneousAY(newY); + break; + } + return true; } QT_END_NAMESPACE diff --git a/src/declarative/particles/qsgwander_p.h b/src/declarative/particles/qsgwander_p.h index 45c8ca8..783efc8 100644 --- a/src/declarative/particles/qsgwander_p.h +++ b/src/declarative/particles/qsgwander_p.h @@ -63,11 +63,19 @@ struct WanderData{ class QSGWanderAffector : public QSGParticleAffector { Q_OBJECT + Q_PROPERTY(qreal pace READ pace WRITE setPace NOTIFY paceChanged) Q_PROPERTY(qreal xVariance READ xVariance WRITE setXVariance NOTIFY xVarianceChanged) Q_PROPERTY(qreal yVariance READ yVariance WRITE setYVariance NOTIFY yVarianceChanged) - Q_PROPERTY(qreal pace READ pace WRITE setPace NOTIFY paceChanged) + Q_PROPERTY(PhysicsAffects physics READ physics WRITE setPhysics NOTIFY physicsChanged) + Q_ENUMS(PhysicsAffects) public: + enum PhysicsAffects { + Position, + Velocity, + Acceleration + }; + explicit QSGWanderAffector(QSGItem *parent = 0); ~QSGWanderAffector(); virtual void reset(int systemIdx); @@ -86,6 +94,12 @@ public: { return m_pace; } + + PhysicsAffects physics() const + { + return m_physics; + } + protected: virtual bool affectParticle(QSGParticleData *d, qreal dt); signals: @@ -96,6 +110,9 @@ signals: void paceChanged(qreal arg); + + void physicsChanged(PhysicsAffects arg); + public slots: void setXVariance(qreal arg) { @@ -121,12 +138,22 @@ void setPace(qreal arg) } } + +void setPhysics(PhysicsAffects arg) +{ + if (m_physics != arg) { + m_physics = arg; + emit physicsChanged(arg); + } +} + private: WanderData* getData(int idx); QHash m_wanderData; qreal m_xVariance; qreal m_yVariance; qreal m_pace; + PhysicsAffects m_physics; }; QT_END_NAMESPACE -- 1.7.2.5