aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/particles/qsgparticleaffector_p.h
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-04 18:15:28 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-06 10:09:09 +0200
commit29c4b643272a43022081cce063394bac823ab529 (patch)
tree10e4fe15bdf68dec90edac0d67b949a92d9204d5 /src/declarative/particles/qsgparticleaffector_p.h
parent87822d24df32311a50dc87ded55ad4d17e8226f0 (diff)
Squashed Particle System Stateful Rewrite
Add TargetAffector Fix for ParticlePainter offsets Adds a particleStates property to ParticleSystem Augment SpriteGoal to change system states as well Also add 'collidingParticles' list to affector. Particle Stochastic States Now actually working, and you can put emitters, affectors and painters inside their targeted state. Fireworks example uses states instead of delegates. Replaced the delegate example with a text thing. The examples launcher now also contains all the custom examples. Adds CumulativeDirection and working null Affector (for affected signal). Add spaces after all flow control keywords. Change-Id: I77b7e3044a9800dbfff6db833914d63127602cf5 Reviewed-on: http://codereview.qt.nokia.com/968 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/particles/qsgparticleaffector_p.h')
-rw-r--r--src/declarative/particles/qsgparticleaffector_p.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/declarative/particles/qsgparticleaffector_p.h b/src/declarative/particles/qsgparticleaffector_p.h
index 7418760941..806a1cce1a 100644
--- a/src/declarative/particles/qsgparticleaffector_p.h
+++ b/src/declarative/particles/qsgparticleaffector_p.h
@@ -57,10 +57,11 @@ class QSGParticleAffector : public QSGItem
Q_OBJECT
Q_PROPERTY(QSGParticleSystem* system READ system WRITE setSystem NOTIFY systemChanged)
Q_PROPERTY(QStringList particles READ particles WRITE setParticles NOTIFY particlesChanged)
+ Q_PROPERTY(QStringList collisionParticles READ collisionParticles WRITE setCollisionParticles NOTIFY collisionParticlesChanged)
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(bool onceOff READ onceOff WRITE setOnceOff NOTIFY onceOffChanged)
Q_PROPERTY(QSGParticleExtruder* shape READ shape WRITE setShape NOTIFY shapeChanged)
- Q_PROPERTY(bool signal READ signal WRITE setSignal NOTIFY signalChanged)
+ Q_PROPERTY(bool signal READ signal WRITE setSignal NOTIFY signalChanged)//TODO: Determine by whether it's connected
public:
explicit QSGParticleAffector(QSGItem *parent = 0);
@@ -96,6 +97,11 @@ public:
return m_signal;
}
+ QStringList collisionParticles() const
+ {
+ return m_collisionParticles;
+ }
+
signals:
void systemChanged(QSGParticleSystem* arg);
@@ -111,6 +117,8 @@ signals:
void affected(qreal x, qreal y);
void signalChanged(bool arg);
+ void collisionParticlesChanged(QStringList arg);
+
public slots:
void setSystem(QSGParticleSystem* arg)
{
@@ -142,6 +150,7 @@ void setOnceOff(bool arg)
{
if (m_onceOff != arg) {
m_onceOff = arg;
+ m_needsReset = true;
emit onceOffChanged(arg);
}
}
@@ -162,6 +171,14 @@ void setSignal(bool arg)
}
}
+void setCollisionParticles(QStringList arg)
+{
+ if (m_collisionParticles != arg) {
+ m_collisionParticles = arg;
+ emit collisionParticlesChanged(arg);
+ }
+}
+
protected:
friend class QSGParticleSystem;
virtual bool affectParticle(QSGParticleData *d, qreal dt);
@@ -183,6 +200,9 @@ private:
bool m_signal;
+ QStringList m_collisionParticles;
+
+ bool isColliding(QSGParticleData* d);
private slots:
void updateOffsets();
};