Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / doc / src / qtquick1 / particles.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
13 ** this file.
14 **
15 ** Other Usage
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
18 ** and Nokia.
19 **
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29   \qmlmodule QtQuick.Particles 2
30   \title QML Module QtQuick.Particles 2
31
32   \brief Elements for the Qt Quick particle system
33
34   This QML module contains a particle system for Qt Quick.
35
36   For a simple overview of how the system can be used, see \l{qml-particles.html}{Using the Qt Quick Particle System}.
37
38 */
39
40 /*!
41     \page qml-particlesystem.html
42 \inqmlmodule QtQuick 1
43     \title Using the Qt Quick Particle System
44
45     \section1 The ParticleSystem
46     This particle system contains four main types of QML Elements: ParticleSystem, Painters, Emitters and Affectors.
47
48     The ParticleSystem element ties all the other elements together, and manages the shared timeline. Painters, Emitters
49     and Affectors must all have the same ParticleSystem to be able to interact with each other.
50
51     You may have as many ParticleSystems as you want subject to this constraint, so the logical separation is to have
52     one ParticleSystem for all the elements that you want to interact, or just one if the number of elements is small
53     and they are easily kept under control..
54
55     \section1 Logical Particles
56     All the particle system elements act on "logical particles". Every particle has a logical representation inside
57     the particle system, and this is what the elements act upon. Not every logical particle needs to be visualized,
58     and some logical particles could lead to multiple visual particles being drawn on screen.
59     \section1 Particle Groups
60     Every logical particle is a member of a particle group, and each group is identified by a name. If no other
61     group has been specified, a logical particle belongs to the group with the name "" (the empty string), which
62     acts the same as any other group. Groups are used for two purposes, for controlling particles and because they
63     can have stochastic state transitions.
64
65     Groups control particles because you can never access an individual particle with any of the particle system
66     elements. All elements act on groups as a whole, and so any particles that need to behave differently from each
67     other (aside from the usual stochastic parameter variation) will need to be in different groups.
68
69     Particles can also change groups dynamically. When this happens the particles trajectory is unaltered, but it
70     can be acted upon by different ParticlePainters or Affectors. Particles can either have their state changed by
71     an Affector, or stochastic state transitions can be defined in the group definition (in the particleStates property).
72     Generally, groups should only be defined in that property if they require stochastic state transitions. Otherwise,
73     it is sufficient to have the groups be defined simply by the strings used in the particle/particles properties
74     of the elements.
75
76     \section1 Emitters
77     Emitters emit logical particles into the system. These particles have a trajectory and lifespan, but no visualization.
78     These particles are emitted from the location of the Emitter.
79
80     FollowEmitters are a special type of emitter which emits particles from the location of other logicial particles. Any logical
81     particle of the followed type within the bounds of a FollowEmitter will cause particle emission from its location, as if there
82     were an Emitter on it with the same properties as the FollowEmitter.
83
84     \section1 ParticlePainters
85     Painters are the elements that visualize logical particles. For each logical particle in the groups assigned to it,
86     which are within its bounds (or outside, if you do not set the clip property on the element) it will be visualized
87     in a manner dependant on the type of ParticlePainter.  The base type of ParticlePainter does not draw anything.
88     ImageParticle renders an image at the particle location. CustomParticle allows you to write your own shaders to render
89     the particles, passing in the logical particle state as vertex data. ItemParticle allows you to visualize logical
90     particles using arbitrary QML delegates. ModelParticle is similar, but coordinates model data amongst the delegates
91     in a similar manner to the view classes.
92
93     As the ParticlePainter is the QML element visualizing the particles in the scene, it is its Z value which is important
94     when trying to place particles above or below other elements visually.
95
96     \section1 Affectors
97     Affectors are an optional component of a particle system. They can perform a variety of manipulations to the simulation,
98     such as altering the trajectory of particles or prematurely ending their life in the simulation. For performance reasons,
99     it is recommended not to use Affectors in high-volume particle systems.
100
101     \section1 Stochastic Parameters
102     As particle systems benefit from stochastic control of parameters across a large number of instances, several stochastic
103     helper types are used by the particle system. If you do not wish to have any stochastic variation in these parameters,
104     then do not specify any variation in these elements.
105
106     \section2 Directions
107     Directions can be specified by angle and magnitude, or by x and y components. While any direction can be specified with
108     either method, there is a significant difference between varying the x and y components and varying the angle and magnitude.
109     Varying the x and y components will lead to a rectangular area around the specified point, while varying the angle will lead
110     to an arc centered on the specfied point.
111
112     \section2 Shapes
113     The particle system contains several elements which represent shapes. These elements do not visualize shapes, and are used
114     for the purpose of selecting a random point within the shape. If you want a specific point with no randomness, use a 0 width
115     and 0 height shape (which is the default). Otherwise you can use the shape elements provides to specify an area, so that the
116     result can use a random point selected from that area.
117 */