aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/particles/affectors
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-28 15:24:18 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-28 15:35:03 +0200
commitba0899542cf03a685335bf4e02edfb377bade224 (patch)
tree554213486fd3420745da3821c3e4502e4c15830f /examples/quick/particles/affectors
parent6f411ef9d460d6a4f73a455b6eec9afc2f52d305 (diff)
parent43484528552cb2ba3dc1dabfcce22ed40bf4f8db (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/quick/doc/src/appdevguide/porting.qdoc sync.profile Change-Id: Iec5516c596c3eca60a3e6ceb1d45f2a7a1595c12
Diffstat (limited to 'examples/quick/particles/affectors')
-rw-r--r--examples/quick/particles/affectors/doc/src/affectors.qdoc34
1 files changed, 17 insertions, 17 deletions
diff --git a/examples/quick/particles/affectors/doc/src/affectors.qdoc b/examples/quick/particles/affectors/doc/src/affectors.qdoc
index 58661d5b70..a1407abda2 100644
--- a/examples/quick/particles/affectors/doc/src/affectors.qdoc
+++ b/examples/quick/particles/affectors/doc/src/affectors.qdoc
@@ -35,7 +35,7 @@
Each example is a small QML file emphasizing a particular type or feature.
Age demonstrates using an Age affector to prematurely end the lives of particles.
- \snippet quick/particles/affectors/content/age.qml 0
+ \snippet particles/affectors/content/age.qml 0
As you move the affector around the screen, the particles inside it
(which haven't already been affected) jump to a period near the end
@@ -44,7 +44,7 @@
the end of their life instantly.
Attractor demonstrates using an Attractor affector to simulate a black hole
- \snippet quick/particles/affectors/content/attractor.qml 0
+ \snippet particles/affectors/content/attractor.qml 0
All particles in the scene, including the rocket ship's exhaust and pellets, are pulled
towards the black hole. This effect is stronger closer to the black hole, so the
@@ -55,58 +55,58 @@
Custom Affector manipulates the properties of the particles directly in javascript.
One Affector is used to make the leaves rock back and forth as they fall, looking more
leaf-like than just spinning in circles:
- \snippet quick/particles/affectors/content/customaffector.qml 0
+ \snippet particles/affectors/content/customaffector.qml 0
Another is used to provide a slightly varying friction to the leaves as they 'land',
to look more natural:
- \snippet quick/particles/affectors/content/customaffector.qml 1
+ \snippet particles/affectors/content/customaffector.qml 1
Friction is similar to the falling leaves in the custom affector, except that it uses a
flat friction the whole way down instead of custom affectors.
- \snippet quick/particles/affectors/content/friction.qml 0
+ \snippet particles/affectors/content/friction.qml 0
Gravity is a convenience affector for applying a constant acceleration to particles inside it
- \snippet quick/particles/affectors/content/gravity.qml 0
+ \snippet particles/affectors/content/gravity.qml 0
GroupGoal sets up two particle groups for flaming and non-flaming balls, and gives you various
ways to transition between them.
- \snippet quick/particles/affectors/content/groupgoal.qml unlit
+ \snippet particles/affectors/content/groupgoal.qml unlit
The non-flaming balls have a one in a hundred chance of lighting on their own each second, but they also
have a GroupGoal set on the whole group. This affector affects all particles of the unlit group, when colliding
with particles in the lit group, and cause them to move to the lighting group.
- \snippet quick/particles/affectors/content/groupgoal.qml lighting
+ \snippet particles/affectors/content/groupgoal.qml lighting
lighting is an intermediate group so that the glow builds up and the transition is less jarring. So it automatically
moves into the lit group after 100ms.
- \snippet quick/particles/affectors/content/groupgoal.qml lit
+ \snippet particles/affectors/content/groupgoal.qml lit
The lit group also has TrailEmitters on it for additional fire and smoke, but does not transition anywhere.
There are two more GroupGoal objects that allow particles in the unlit group to transition to the lighting group
(and then to the lit group).
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-pilot
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-pilot
The first is just an area bound to the location of an image of a pilot flame. When unlit balls pass through the flame,
they go straight to lit because the pilot flame is so hot.
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-ma
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-ma
The second is bound to the location of the last pointer interaction, so that touching or clicking on unlit balls (which
is hard due to their constant movement) causes them to move to the lighting group.
Move shows some simple effects you can get by altering trajectory midway.
The red particles have an affector that affects their position, jumping them forwards by 120px.
- \snippet quick/particles/affectors/content/move.qml A
+ \snippet particles/affectors/content/move.qml A
The green particles have an affector that affects their velocity, but with some angle variation. By adding some random direction
velocity to their existing forwards velocity, they begin to spray off in a cone.
- \snippet quick/particles/affectors/content/move.qml B
+ \snippet particles/affectors/content/move.qml B
The blue particles have an affector that affects their acceleration, and because it sets relative to false this resets the acceleration instead of
adding to it. Once the blue particles reach the affector, their horizontal velocity stops increasing as their vertical velocity decreases.
- \snippet quick/particles/affectors/content/move.qml C
+ \snippet particles/affectors/content/move.qml C
SpriteGoal has an affector which interacts with the sprite engine of particles, if they are being drawn as sprites by ImageParticle.
- \snippet quick/particles/affectors/content/spritegoal.qml 0
+ \snippet particles/affectors/content/spritegoal.qml 0
The SpriteGoal follows the image of the rocket ship on screen, and when it interacts with particles drawn by ImageParticle as sprites,
it instructs them to move immediately to the "explode" state, which in this case is the animation of the asteroid breaking into many pieces.
Turbulence has a flame with smoke, and both sets of particles being affected by a Turbulence affector. This gives a faint wind effect.
- \snippet quick/particles/affectors/content/turbulence.qml 0
+ \snippet particles/affectors/content/turbulence.qml 0
To make the wind change direction, subsitute a black and white noise image in the noiseSource parameter (it currently uses a default noise source).
Wander uses a Wander affector to add some horizontal drift to snowflakes as they fall down.
- \snippet quick/particles/affectors/content/wander.qml 0
+ \snippet particles/affectors/content/wander.qml 0
There are different movements given by applying the Wander to different attributes of the trajectory, so the example makes it easy to play around and see the difference.
*/