1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLETRAILEMITTER_H
5#define QQUICK3DPARTICLETRAILEMITTER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DParticles/private/qquick3dparticleemitter_p.h>
19#include <QtQuick3DParticles/private/qquick3dparticle_p.h>
20#include <QtQuick3DParticles/private/qquick3dparticledata_p.h>
21#include <QQmlEngine>
22#include <QList>
23
24QT_BEGIN_NAMESPACE
25
26class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleTrailEmitter : public QQuick3DParticleEmitter
27{
28 Q_OBJECT
29 Q_PROPERTY(QQuick3DParticle *follow READ follow WRITE setFollow NOTIFY followChanged)
30 QML_NAMED_ELEMENT(TrailEmitter3D)
31 QML_ADDED_IN_VERSION(6, 2)
32
33public:
34 QQuick3DParticleTrailEmitter(QQuick3DNode *parent = nullptr);
35
36 QQuick3DParticle *follow() const;
37
38 Q_INVOKABLE void burst(int count) override;
39
40public Q_SLOTS:
41 void setFollow(QQuick3DParticle *follow);
42
43Q_SIGNALS:
44 void followChanged();
45
46protected:
47 friend class QQuick3DParticleSystem;
48 void emitTrailParticles(const QVector3D &centerPos, int emitAmount, int triggerType);
49 bool hasBursts() const;
50 void clearBursts();
51
52private:
53 QQuick3DParticle *m_follow = nullptr;
54 QList<QQuick3DParticleEmitBurstData> m_bursts;
55
56};
57
58QT_END_NAMESPACE
59
60#endif // QQUICK3DPARTICLETRAILEMITTER_H
61

source code of qtquick3d/src/quick3dparticles/qquick3dparticletrailemitter_p.h