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
qquick3dparticlepointrotator_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 QQUICK3DPARTICLEPOINTROTATOR_H
5#define QQUICK3DPARTICLEPOINTROTATOR_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 <QObject>
19#include <QtQuick3DParticles/private/qquick3dparticleaffector_p.h>
20
22
23class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticlePointRotator : public QQuick3DParticleAffector
24{
26 Q_PROPERTY(float magnitude READ magnitude WRITE setMagnitude NOTIFY magnitudeChanged)
27 Q_PROPERTY(QVector3D direction READ direction WRITE setDirection NOTIFY directionChanged)
28 Q_PROPERTY(QVector3D pivotPoint READ pivotPoint WRITE setPivotPoint NOTIFY pivotPointChanged)
29 QML_NAMED_ELEMENT(PointRotator3D)
31
32public:
34
35 float magnitude() const;
36 QVector3D direction() const;
37 QVector3D pivotPoint() const;
38
39public Q_SLOTS:
40 void setMagnitude(float magnitude);
41 void setDirection(const QVector3D &direction);
42 void setPivotPoint(const QVector3D &point);
43
45 void magnitudeChanged();
46 void directionChanged();
47 void pivotPointChanged();
48
49protected:
50 void prepareToAffect() override;
51 void affectParticle(const QQuick3DParticleData &sd, QQuick3DParticleDataCurrent *d, float time) override;
52
54 float m_magnitude = 10.0f;
55 QVector3D m_direction = {0.0f, 1.0f, 0.0f};
56 QVector3D m_directionNormalized = {0.0f, 1.0f, 0.0f};
57 QVector3D m_pivotPoint;
58 QMatrix4x4 m_rotationMatrix;
59};
60
62
63#endif // QQUICK3DPARTICLEPOINTROTATOR_H
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
direction
Combined button and popup list for selecting options.
GLfloat GLfloat f
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS