ModelParticle3D QML Type
Partikel unter Verwendung eines „ Qt Quick 3D “-Modells. Mehr...
| Import Statement: | import QtQuick3D.Particles3D |
| Since: | Qt 6.2 |
| Inherits: |
Eigenschaften
- delegate : Component
- instanceTable : Instancing
Ausführliche Beschreibung
Das „ModelParticle3D“ ist ein logisches Partikelelement, das Partikel aus einer „ Qt Quick 3D “- Model -Komponente erzeugt.
Dokumentation der Eigenschaften
delegate : Component
Der Delegat stellt eine Vorlage bereit, die jedes vom Partikel instanziierte Objekt definiert.
Beispiel für die Zuweisung von 200 roten Würfelpartikeln:
Component {
id: particleComponent
Model {
source: "#Cube"
scale: Qt.vector3d(0.2, 0.2, 0.2)
materials: DefaultMaterial { }
}
}
ModelParticle3D {
id: particleRed
delegate: particleComponent
maxAmount: 200
color: "#ff0000"
}Hinweis: Der aus dem Delegaten instanziierte Inhalt behält seine eigene „ layers “-Zuweisung bei; der „layers“-Wert des „ ParticleSystem3D “ wird nicht auf ihn angewendet. Um die Partikel auf einer bestimmten Inhaltsschicht darzustellen, legen Sie die „layers“-Eigenschaft für die Knoten im Delegaten fest.
instanceTable : Instancing
Die `instanceTable` ermöglicht den Zugriff auf die ` Instancing `-Tabelle des Modellpartikels. „ ModelParticle3D “ nutzt eine interne Instanztabelle, um ein effizientes Rendering zu gewährleisten. Diese Tabelle kann auf die Eigenschaft ` instancing ` von Modellen angewendet werden, die nicht Teil des Partikelsystems sind.
Es ist auch möglich, diese Funktion zu nutzen, um eine Instanztabelle bereitzustellen, ohne Partikel anzuzeigen. Dies geschieht durch Weglassen der Eigenschaft „ delegate “. Beispiel:
ParticleSystem3D {
id: psystem
ModelParticle3D {
id: particleRed
maxAmount: 200
color: "#ff0000"
colorVariation: Qt.vector4d(0.5,0.5,0.5,0.5)
}
ParticleEmitter3D {
particle: particleRed
velocity: VectorDirection3D {
direction: Qt.vector3d(-20, 200, 0)
directionVariation: Qt.vector3d(20, 20, 20)
}
particleScale: 0.2
emitRate: 20
lifeSpan: 2000
}
}
Model {
source: "#Sphere"
instancing: particleRed.instanceTable
materials: PrincipledMaterial {
baseColor: "yellow"
}
}© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.