src/imports/particles/qdeclarativeparticles.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   152     Q_UNUSED(particle);
   152     Q_UNUSED(particle);
   153 }
   153 }
   154 
   154 
   155 /*!
   155 /*!
   156     \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
   156     \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
       
   157     \ingroup qml-particle-elements
   157     \since 4.7
   158     \since 4.7
   158     \brief The ParticleMotionLinear object moves particles linearly.
   159     \brief The ParticleMotionLinear object moves particles linearly.
   159 
   160 
   160     \sa Particles
   161     \sa Particles
   161 
   162 
   162     This is the default motion, and moves the particles according to the
   163     This is the default motion, and moves the particles according to the
   163     properties specified in the Particles element.
   164     properties specified in the Particles element.
   164 
   165 
   165     It has no further properties.
   166     It has no further properties.
   166 */
   167 */
   167 
       
   168 /*!
       
   169     \internal
       
   170     \class QDeclarativeParticleMotionLinear
       
   171     \ingroup group_effects
       
   172     \brief The QDeclarativeParticleMotionLinear class moves the particles linearly.
       
   173 */
       
   174 
       
   175 void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval)
   168 void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval)
   176 {
   169 {
   177     p.x += interval * p.x_velocity;
   170     p.x += interval * p.x_velocity;
   178     p.y += interval * p.y_velocity;
   171     p.y += interval * p.y_velocity;
   179 }
   172 }
   180 
   173 
   181 /*!
   174 /*!
   182     \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
   175     \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
       
   176     \ingroup qml-particle-elements
   183     \since 4.7
   177     \since 4.7
   184     \brief The ParticleMotionGravity object moves particles towards a point.
   178     \brief The ParticleMotionGravity object moves particles towards a point.
   185 
   179 
   186     This motion attracts the particles to the specified point with the specified acceleration.
   180     This motion attracts the particles to the specified point with the specified acceleration.
   187     To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8.
   181     To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8.
   189     The defaults are all 0, not earth gravity, and so no motion will occur without setting
   183     The defaults are all 0, not earth gravity, and so no motion will occur without setting
   190     at least the acceleration property.
   184     at least the acceleration property.
   191 
   185 
   192 
   186 
   193     \sa Particles
   187     \sa Particles
   194 */
       
   195 
       
   196 /*!
       
   197     \internal
       
   198     \class QDeclarativeParticleMotionGravity
       
   199     \ingroup group_effects
       
   200     \brief The QDeclarativeParticleMotionGravity class moves the particles towards a point.
       
   201 
       
   202 */
   188 */
   203 
   189 
   204 /*!
   190 /*!
   205     \qmlproperty real ParticleMotionGravity::xattractor
   191     \qmlproperty real ParticleMotionGravity::xattractor
   206     \qmlproperty real ParticleMotionGravity::yattractor
   192     \qmlproperty real ParticleMotionGravity::yattractor
   269     p.y += interval * p.y_velocity;
   255     p.y += interval * p.y_velocity;
   270 }
   256 }
   271 
   257 
   272 /*!
   258 /*!
   273     \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
   259     \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
       
   260     \ingroup qml-particle-elements
   274     \since 4.7
   261     \since 4.7
   275     \brief The ParticleMotionWander object moves particles in a somewhat random fashion.
   262     \brief The ParticleMotionWander object moves particles in a somewhat random fashion.
   276 
   263 
   277     The particles will continue roughly in the original direction, however will randomly
   264     The particles will continue roughly in the original direction, however will randomly
   278     drift to each side.
   265     drift to each side.
   303     }
   290     }
   304 }
   291 }
   305     \endqml
   292     \endqml
   306 
   293 
   307     \sa Particles
   294     \sa Particles
   308 */
       
   309 
       
   310 /*!
       
   311     \internal
       
   312     \class QDeclarativeParticleMotionWander
       
   313     \ingroup group_effects
       
   314     \brief The QDeclarativeParticleMotionWander class moves particles in a somewhat random fashion.
       
   315 
       
   316     The particles will continue roughly in the original direction, however will randomly
       
   317     drift to each side.
       
   318 */
   295 */
   319 
   296 
   320 /*!
   297 /*!
   321     \qmlproperty real ParticleMotionWander::xvariance
   298     \qmlproperty real ParticleMotionWander::xvariance
   322     \qmlproperty real ParticleMotionWander::yvariance
   299     \qmlproperty real ParticleMotionWander::yvariance
   632     }
   609     }
   633 }
   610 }
   634 
   611 
   635 /*!
   612 /*!
   636     \qmlclass Particles QDeclarativeParticles
   613     \qmlclass Particles QDeclarativeParticles
       
   614     \ingroup qml-particle-elements
   637     \since 4.7
   615     \since 4.7
   638     \brief The Particles object generates and moves particles.
   616     \brief The Particles object generates and moves particles.
   639     \inherits Item
   617     \inherits Item
   640 
   618 
   641     Particles are available in the \bold{Qt.labs.particles 1.0} module.
   619     Particles are available in the \bold{Qt.labs.particles 1.0} module.
   703 }
   681 }
   704     \endqml
   682     \endqml
   705     \image particles.gif
   683     \image particles.gif
   706 */
   684 */
   707 
   685 
   708 /*!
       
   709     \internal
       
   710     \class QDeclarativeParticles
       
   711     \ingroup group_effects
       
   712     \brief The QDeclarativeParticles class generates and moves particles.
       
   713 */
       
   714 
       
   715 QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent)
   686 QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent)
   716     : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent)
   687     : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent)
   717 {
   688 {
   718     Q_D(QDeclarativeParticles);
   689     Q_D(QDeclarativeParticles);
   719     d->init();
   690     d->init();