Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 6e2327ca1c896c6d674ae53117299f21 > files > 1405

qtdeclarative5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- particles.qdoc -->
  <title>Using the Qt Quick Particle System | Qt Quick 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td >Using the Qt Quick Particle System</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#the-particlesystem">The ParticleSystem</a></li>
<li class="level1"><a href="#logical-particles">Logical Particles</a></li>
<li class="level1"><a href="#particle-groups">Particle Groups</a></li>
<li class="level1"><a href="#emitters">Emitters</a></li>
<li class="level1"><a href="#particlepainters">ParticlePainters</a></li>
<li class="level1"><a href="#affectors">Affectors</a></li>
<li class="level1"><a href="#stochastic-parameters">Stochastic Parameters</a></li>
<li class="level2"><a href="#directions">Directions</a></li>
<li class="level2"><a href="#shapes">Shapes</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Using the Qt Quick Particle System</h1>
<span class="subtitle"></span>
<!-- $$$qtquick-effects-particles.html-description -->
<div class="descr"> <a name="details"></a>
<p>Documentation for all Particle System types can be found on the <a href="qtquick-particles-qmlmodule.html">QtQuick.Particles</a> module page.</p>
<p>To use the types from the particles module, import the module with the following line:</p>
<pre class="qml">



</pre>
<a name="the-particlesystem"></a>
<h2 id="the-particlesystem">The ParticleSystem</h2>
<p>This particle system contains four main types of QML types: <a href="qml-qtquick-particles-particlesystem.html">ParticleSystem</a>, Painters, Emitters and Affectors.</p>
<p>The <a href="qml-qtquick-particles-particlesystem.html">ParticleSystem</a> type ties all the other types together, and manages the shared timeline. Painters, Emitters and Affectors must all have the same <a href="qml-qtquick-particles-particlesystem.html">ParticleSystem</a> to be able to interact with each other.</p>
<p>You may have as many ParticleSystems as you want subject to this constraint, so the logical separation is to have one <a href="qml-qtquick-particles-particlesystem.html">ParticleSystem</a> for all the types that you want to interact, or just one if the number of types is small and they are easily kept under control..</p>
<a name="logical-particles"></a>
<h2 id="logical-particles">Logical Particles</h2>
<p>All the particle system types act on &quot;logical particles&quot;. Every particle has a logical representation inside the particle system, and this is what the types act upon. Not every logical particle needs to be visualized, and some logical particles could lead to multiple visual particles being drawn on screen.</p>
<a name="particle-groups"></a>
<h2 id="particle-groups">Particle Groups</h2>
<p>Every logical particle is a member of a particle group, and each group is identified by a name. If no other group has been specified, a logical particle belongs to the group with the name &quot;&quot; (the empty string), which acts the same as any other group. Groups are used for two purposes, for controlling particles and because they can have stochastic state transitions.</p>
<p>Groups control particles because you can never access an individual particle with any of the particle system types. All types act on groups as a whole, and so any particles that need to behave differently from each other (aside from the usual stochastic parameter variation) will need to be in different groups.</p>
<p>Particles can also change groups dynamically. When this happens the particles trajectory is unaltered, but it can be acted upon by different <a href="qtquick-effects-particles.html#particlepainters">ParticlePainters</a> or Affectors. Particles can either have their group changed by an Affector, or stochastic state transitions can be defined in a <a href="qml-qtquick-particles-particlegroup.html">ParticleGroup</a> type.</p>
<p>Generally, groups should only be defined in a <a href="qml-qtquick-particles-particlegroup.html">ParticleGroup</a> if they require stochastic state transitions. Otherwise, it is sufficient to have the groups be defined simply by the strings used in the particle/particles properties of the types.</p>
<a name="emitters"></a>
<h2 id="emitters">Emitters</h2>
<p>Emitters emit logical particles into the system. These particles have a trajectory and lifespan, but no visualization. These particles are emitted from the location of the Emitter.</p>
<p>TrailEmitters are a special type of emitter which emits particles from the location of other logicial particles. Any logical particle of the followed type within the bounds of a <a href="qml-qtquick-particles-trailemitter.html">TrailEmitter</a> will cause particle emission from its location, as if there were an Emitter on it with the same properties as the <a href="qml-qtquick-particles-trailemitter.html">TrailEmitter</a>.</p>
<a name="particlepainters"></a>
<h2 id="particlepainters">ParticlePainters</h2>
<p>Painters are the types that visualize logical particles. For each logical particle in the groups assigned to it, which are within its bounds (or outside, if you do not set the clip property on the type) it will be visualized in a manner dependent on the type of <a href="qml-qtquick-particles-particlepainter.html">ParticlePainter</a>. The base type of <a href="qml-qtquick-particles-particlepainter.html">ParticlePainter</a> does not draw anything. <a href="qml-qtquick-particles-imageparticle.html">ImageParticle</a> renders an image at the particle location. <a href="qml-qtquick-particles-customparticle.html">CustomParticle</a> allows you to write your own shaders to render the particles, passing in the logical particle state as vertex data. <a href="qml-qtquick-particles-itemparticle.html">ItemParticle</a> allows you to visualize logical particles using arbitrary QML delegates. ModelParticle is similar, but coordinates model data amongst the delegates in a similar manner to the view classes.</p>
<p>As the <a href="qml-qtquick-particles-particlepainter.html">ParticlePainter</a> is the QML type visualizing the particles in the scene, it is its Z value which is important when trying to place particles above or below other types visually.</p>
<a name="affectors"></a>
<h2 id="affectors">Affectors</h2>
<p>Affectors are an optional component of a particle system. They can perform a variety of manipulations to the simulation, such as altering the trajectory of particles or prematurely ending their life in the simulation. For performance reasons, it is recommended not to use Affectors in high-volume particle systems.</p>
<a name="stochastic-parameters"></a>
<h2 id="stochastic-parameters">Stochastic Parameters</h2>
<p>As particle systems benefit from stochastic control of parameters across a large number of instances, several stochastic helper types are used by the particle system. If you do not wish to have any stochastic variation in these parameters, then do not specify any variation in these types.</p>
<a name="directions"></a>
<h3 id="directions">Directions</h3>
<p>Directions can be specified by angle and magnitude, or by x and y components. While any direction can be specified with either method, there is a significant difference between varying the x and y components and varying the angle and magnitude. Varying the x and y components will lead to a rectangular area around the specified point, while varying the angle will lead to an arc centered on the specified point.</p>
<a name="shapes"></a>
<h3 id="shapes">Shapes</h3>
<p>The particle system contains several types which represent shapes. These types do not visualize shapes, and are used for the purpose of selecting a random point within the shape. If you want a specific point with no randomness, use a 0 width and 0 height shape (which is the default). Otherwise you can use the shape types to specify an area, so that the result can use a random point selected from that area.</p>
</div>
<!-- @@@qtquick-effects-particles.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>