41 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
42 Q_PROPERTY(QQuick3DInstancing *instanceTable READ instanceTable NOTIFY instanceTableChanged)
44 QML_NAMED_ELEMENT(ModelParticle3D)
45 Q_CLASSINFO(
"DefaultProperty",
"delegate")
46 QML_ADDED_IN_VERSION(6, 2)
49 QQuick3DParticleModelParticle(QQuick3DNode *parent =
nullptr);
51 QQmlComponent *delegate()
const;
52 QQuick3DInstancing *instanceTable()
const;
55 void setDelegate(QQmlComponent *delegate);
58 void delegateChanged();
59 void instanceTableChanged();
62 void componentComplete() override;
63 void itemChange(ItemChange change,
const ItemChangeData &value) override;
65 void setDepthBias(
float bias) override
67 QQuick3DParticle::setDepthBias(bias);
69 updateDepthBias(bias);
73 void handleMaxAmountChanged(
int amount);
74 void handleSortModeChanged(QQuick3DParticle::SortMode mode);
76 friend class QQuick3DParticleSystem;
77 friend class QQuick3DParticleEmitter;
79 void clearInstanceTable();
80 void addInstance(
const QVector3D &position,
const QVector3D &scale,
81 const QVector3D &eulerRotation,
const QColor &color,
83 void commitInstance();
84 void updateDepthBias(
float bias);
86 QPointer<QQmlComponent> m_delegate;
87 QPointer<QQuick3DNode> m_node;
88 QQuick3DParticleInstanceTable *m_instanceTable =
nullptr;
90 QVector3D m_initialScale;
static QVector3D reflect(const QVector3D &I, QVector3D &N)
static QMatrix4x4 rotationFromNormal(const QVector3D &n)