ModelParticle3D QML Type
Qt Quick の3Dモデルを使用したパーティクル。詳細...
| Import Statement: | import QtQuick3D.Particles3D |
| Since: | Qt 6.2 |
| Inherits: |
プロパティ
- delegate : Component
- instanceTable : Instancing
詳細な説明
ModelParticle3Dは、Qt Quick の3Dコンポーネント「Model 」からパーティクルを生成する論理パーティクル要素です。
プロパティのドキュメント
delegate : Component
デリゲートは、パーティクルによってインスタンス化される各オブジェクトを定義するテンプレートを提供します。
たとえば、200個の赤い立方体のパーティクルを割り当てる場合は、次のようにします。
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"
}注: デリゲートからインスタンス化されたコンテンツは 、独自のlayers 割り当てを保持します。ParticleSystem3D のlayers値は、このコンテンツには適用されません。特定のコンテンツレイヤー上でパーティクルをレンダリングするには、デリゲート内のノードでlayersプロパティを設定してください。
instanceTable : Instancing
instanceTable プロパティは、モデルパーティクルの「Instancing 」テーブルへのアクセスを提供します。ModelParticle3D は、効率的なレンダリングを実現するために内部のインスタンステーブルを使用しています。このテーブルは、パーティクルシステムに属さないモデルのinstancing プロパティにも適用できます。
また、この機能を使用して、パーティクルを表示せずにインスタンス化テーブルを提供することも可能です。これを行うには、delegate プロパティを省略します。例:
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.