39 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
40 Q_PROPERTY(QQuick3DInstancing *instanceTable READ instanceTable NOTIFY instanceTableChanged)
42 QML_NAMED_ELEMENT(ModelParticle3D)
43 Q_CLASSINFO(
"DefaultProperty",
"delegate")
44 QML_ADDED_IN_VERSION(6, 2)
47 QQuick3DParticleModelParticle(QQuick3DNode *parent =
nullptr);
49 QQmlComponent *delegate()
const;
50 QQuick3DInstancing *instanceTable()
const;
53 void setDelegate(QQmlComponent *delegate);
56 void delegateChanged();
57 void instanceTableChanged();
60 void componentComplete() override;
61 void itemChange(ItemChange change,
const ItemChangeData &value) override;
63 void setDepthBias(
float bias) override
65 QQuick3DParticle::setDepthBias(bias);
67 updateDepthBias(bias);
71 void handleMaxAmountChanged(
int amount);
72 void handleSortModeChanged(QQuick3DParticle::SortMode mode);
74 friend class QQuick3DParticleSystem;
75 friend class QQuick3DParticleEmitter;
77 void clearInstanceTable();
78 void addInstance(
const QVector3D &position,
const QVector3D &scale,
79 const QVector3D &eulerRotation,
const QColor &color,
81 void commitInstance();
82 void updateDepthBias(
float bias);
84 QPointer<QQmlComponent> m_delegate;
85 QPointer<QQuick3DNode> m_node;
86 QQuick3DParticleInstanceTable *m_instanceTable =
nullptr;
88 QVector3D m_initialScale;
static QVector3D reflect(const QVector3D &I, QVector3D &N)
static QMatrix4x4 rotationFromNormal(const QVector3D &n)