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
qquickage.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 "qquickage_p.h"
47 QQuickParticleAffector(parent), m_lifeLeft(0), m_advancePosition(true)
48{
49}
50
51
53{
54 Q_UNUSED(dt);
55 if (d->stillAlive(m_system)){
56 float curT = m_system->timeInt / 1000.0f;
57 float ttl = m_lifeLeft / 1000.0f;
58 if (!m_advancePosition && ttl > 0){
59 float x = d->curX(m_system);
60 float vx = d->curVX(m_system);
61 float ax = d->curAX();
62 float y = d->curY(m_system);
63 float vy = d->curVY(m_system);
64 float ay = d->curAY();
65 d->t = curT - (d->lifeSpan - ttl);
66 d->setInstantaneousX(x, m_system);
67 d->setInstantaneousVX(vx, m_system);
68 d->setInstantaneousAX(ax, m_system);
69 d->setInstantaneousY(y, m_system);
70 d->setInstantaneousVY(vy, m_system);
71 d->setInstantaneousAY(ay, m_system);
72 } else {
73 d->t = curT - (d->lifeSpan - ttl);
74 }
75 return true;
76 }
77 return false;
78}
80
81#include "moc_qquickage_p.cpp"
bool affectParticle(QQuickParticleData *d, qreal dt) override
Definition qquickage.cpp:52
QQuickAgeAffector(QQuickItem *parent=nullptr)
\qmltype Age \instantiates QQuickAgeAffector \inqmlmodule QtQuick.Particles \inherits Affector
Definition qquickage.cpp:46
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QQuickParticleSystem * m_system
Combined button and popup list for selecting options.
GLint GLint GLint GLint GLint x
[0]
GLint y
#define Q_UNUSED(x)
double qreal
Definition qtypes.h:187