85bool QQuickSpriteGoalAffector::affectParticle(QQuickParticleData *d, qreal dt)
88 QQuickStochasticEngine *engine =
nullptr;
91 for (QQuickParticlePainter *p : m_system->groupData[d->groupId]->painters) {
92 if (qobject_cast<QQuickImageParticle*>(p))
93 engine = qobject_cast<QQuickImageParticle*>(p)->spriteEngine();
96 engine = m_system->stateEngine;
98 m_notUsingEngine =
true;
100 if (!engine && !m_notUsingEngine)
103 if (m_goalIdx == -2 || engine != m_lastEngine)
104 updateStateIndex(engine);
105 int index = d->index;
107 index = d->systemIndex;
108 if (m_notUsingEngine){
110 m_system->moveGroups(d, m_goalIdx);
111 }
else if (engine->curState(index) != m_goalIdx){
112 engine->setGoal(m_goalIdx, index, m_jump);