Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquick3dparticleattractor_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLEATTRACTOR_H
5#define QQUICK3DPARTICLEATTRACTOR_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/qquick3dparticleaffector_p.h>
19#include <QtQuick3DParticles/private/qquick3dparticleshape_p.h>
20
22
23class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleAttractor : public QQuick3DParticleAffector
24{
26 Q_PROPERTY(QVector3D positionVariation READ positionVariation WRITE setPositionVariation NOTIFY positionVariationChanged)
27 Q_PROPERTY(QQuick3DParticleAbstractShape *shape READ shape WRITE setShape NOTIFY shapeChanged)
28 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
29 Q_PROPERTY(int durationVariation READ durationVariation WRITE setDurationVariation NOTIFY durationVariationChanged)
30 Q_PROPERTY(bool hideAtEnd READ hideAtEnd WRITE setHideAtEnd NOTIFY hideAtEndChanged)
31 Q_PROPERTY(bool useCachedPositions READ useCachedPositions WRITE setUseCachedPositions NOTIFY useCachedPositionsChanged)
32 Q_PROPERTY(int positionsAmount READ positionsAmount WRITE setPositionsAmount NOTIFY positionsAmountChanged)
33 QML_NAMED_ELEMENT(Attractor3D)
35
36public:
38
39 QVector3D positionVariation() const;
40 QQuick3DParticleAbstractShape *shape() const;
41 int duration() const;
42 int durationVariation() const;
43 bool hideAtEnd() const;
44 bool useCachedPositions() const;
45 int positionsAmount() const;
46
47public Q_SLOTS:
48 void setPositionVariation(const QVector3D &positionVariation);
49 void setShape(QQuick3DParticleAbstractShape *shape);
50 void setDuration(int duration);
51 void setDurationVariation(int durationVariation);
52 void setHideAtEnd(bool hideAtEnd);
53 void setUseCachedPositions(bool useCachedPositions);
54 void setPositionsAmount(int positionsAmount);
55
64
65protected:
66 void prepareToAffect() override;
68
69private:
70 void updateShapePositions();
71
72 QQuick3DParticleAbstractShape *m_shape = nullptr;
73 QList<QVector3D> m_shapePositionList;
74 QVector3D m_centerPos;
75 QMatrix4x4 m_particleTransform;
76 bool m_shapeDirty = false;
77 int m_duration = -1;
78 int m_durationVariation = 0;
79 QVector3D m_positionVariation;
80 bool m_hideAtEnd = false;
81 bool m_useCachedPositions = true;
82 int m_positionsAmount = 0;
83};
84
86
87#endif // QQUICK3DPARTICLEATTRACTOR_H
Definition qlist.h:74
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
virtual void affectParticle(const QQuick3DParticleData &sd, QQuick3DParticleDataCurrent *d, float time)=0
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
animation setDuration(1000)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent