Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickgroupgoal.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickgroupgoal_p.h"
5#include <private/qquickspriteengine_p.h>
6#include <private/qquicksprite_p.h>
8#include <QDebug>
9
11
46
48{
49 if (m_goalState != arg) {
50 m_goalState = arg;
52 }
53}
54
56{
57 Q_UNUSED(dt);
59 int index = d->systemIndex;
60 int goalIdx = m_system->groupIds[m_goalState];
61 if (!engine){//no stochastic states defined. So cut out the engine
62 //TODO: It's possible to move to a group that is intermediate and not used by painters or emitters - but right now that will redirect to the default group
63 m_system->moveGroups(d, goalIdx);
64 return true;
65 }else if (engine->curState(index) != goalIdx){
66 engine->setGoal(goalIdx, index, m_jump);
67 return true;
68 }
69 return false;
70}
71
73
74#include "moc_qquickgroupgoal_p.cpp"
bool affectParticle(QQuickParticleData *d, qreal dt) override
QQuickGroupGoalAffector(QQuickItem *parent=nullptr)
\qmltype GroupGoal \instantiates QQuickGroupGoalAffector \inqmlmodule QtQuick.Particles\inherits Affe...
void setGoalState(const QString &arg)
void goalStateChanged(const QString &arg)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QQuickParticleSystem * m_system
QQuickStochasticEngine * stateEngine
QHash< QString, int > groupIds
void moveGroups(QQuickParticleData *d, int newGIdx)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLuint index
[2]
SSL_CTX int void * arg
#define emit
#define Q_UNUSED(x)
double qreal
Definition qtypes.h:187
QJSEngine engine
[0]