aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickparticleaffector.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-05-31 16:45:45 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-06 07:50:44 +0200
commit7b181d599f87f628f7e019aa451ff670fdb29d9f (patch)
tree50fbb8cc707217b3cbb8a8ee7485d2a1553f1d64 /src/particles/qquickparticleaffector.cpp
parent9fdf7be30568e2298cdc7a911cbbfbed0453d31f (diff)
Fix affected signal and docs
Signal wasn't being called in its primary usecase, which was to interact without altering the particles. Docs have been updated to clarify the usecase as well. This also updates the position properties of custom affector to more accurately specify if they caused changes. Change-Id: Ia411d9e81002443a56ed8bab9232f1aad49a4c5e Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/particles/qquickparticleaffector.cpp')
-rw-r--r--src/particles/qquickparticleaffector.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/particles/qquickparticleaffector.cpp b/src/particles/qquickparticleaffector.cpp
index 471484e287..978c53e9a2 100644
--- a/src/particles/qquickparticleaffector.cpp
+++ b/src/particles/qquickparticleaffector.cpp
@@ -114,30 +114,16 @@ QT_BEGIN_NAMESPACE
non-rectangular area.
*/
/*!
- \qmlsignal QtQuick.Particles2::Affector::onAffected(x, y)
-
- This signal is emitted each time the affector actually affects a particle.
-
- x,y are the coordinates of the affected particle, relative to the ParticleSystem.
-
-*/
-
-/*!
- \qmlsignal QtQuick.Particles2::Affector::affectParticle(particle particle, real dt)
-
- This handler is called when particles are selected to be affected.
-
- dt is the time since the last time it was affected. Use dt to normalize
- trajectory manipulations to real time.
-
- Note that JS is slower to execute, so it is not recommended to use this in
- high-volume particle systems.
-*/
-/*!
\qmlsignal QtQuick.Particles2::Affector::affected(real x, real y)
- This handler is called when a particle is selected to be affected. It will
- only be called if signal is set to true.
+ This handler is called when a particle is selected to be affected. It will not be called
+ if a particle is considered by the Affector but not actually altered in any way.
+
+ In the special case where an Affector has no possible effect (e.g. Affector {}), affected
+ will be emitted for all particles being considered if you connect to it. This allows you to
+ execute arbitrary code in response to particles (see \l affectParticles if you want to execute
+ code which affects the particles themselves) . As this executes JS scritps per particle, it is
+ not recommended to use this signal with a high-volume particle system.
x,y is the particles current position.
*/