/*!
\qmlproperty real QtQuick.Particles2::FollowEmitter::emitRatePerParticle
*/
+/*!
+ \qmlsignal QtQuick.Particles2::FollowEmitter::emitFollowParticle(particle, followed)
+
+ This handler is called when a particle is emitted. You can modify particle
+ attributes from within the handler. followed is the particle that this is being
+ emitted off of.
+ If you use this signal handler, emitParticle will not be emitted.
+*/
+
+bool QSGFollowEmitter::isEmitFollowConnected()
+{
+ static int idx = QObjectPrivate::get(this)->signalIndex("emitFollowParticle(QDeclarativeV8Handle,QDeclarativeV8Handle)");
+ return QObjectPrivate::get(this)->isSignalConnected(idx);
+}
void QSGFollowEmitter::recalcParticlesPerSecond(){
if (!m_system)
// Particle speed
const QPointF &speed = m_speed->sample(newPos);
- datum->vx = speed.x();
+ datum->vx = speed.x()
+ + m_speed_from_movement * d->vx;
datum->vy = speed.y();
+ + m_speed_from_movement * d->vy;
// Particle acceleration
const QPointF &accel = m_acceleration->sample(newPos);
datum->size = size * float(m_emitting);
datum->endSize = endSize * float(m_emitting);
+ if (isEmitFollowConnected())
+ emitFollowParticle(datum->v8Value(), d->v8Value());//A chance for many arbitrary JS changes
+ else if (isEmitConnected())
+ emitParticle(datum->v8Value());//A chance for arbitrary JS changes
+
m_system->emitParticle(datum);
}
if (!m_burstQueue.isEmpty()){
}
signals:
+ void emitFollowParticle(QDeclarativeV8Handle particle, QDeclarativeV8Handle followed);
void particlesPerParticlePerSecondChanged(int arg);
int m_followCount;
QSGParticleExtruder* m_emissionExtruder;
QSGParticleExtruder* m_defaultEmissionExtruder;
+ bool isEmitFollowConnected();
};
QT_END_NAMESPACE
*/
//TODO: Document particle 'type'
/*!
- \qmlsignal QtQuick.Particles2::Emitter::emitting(particle)
+ \qmlsignal QtQuick.Particles2::Emitter::emitParticle(particle)
This handler is called when a particle is emitted. You can modify particle
attributes from within the handler.