ModelParticle3D QML Type

Qt Quick 3D モデルを使用したパーティクル。詳細...

Import Statement: import QtQuick3D.Particles3D
Since: Qt 6.2
Inherits:

Particle3D

プロパティ

詳細説明

ModelParticle3D は、Qt Quick 3DModel コンポーネントからパーティクルを作成する論理パーティクル要素です。

プロパティの説明

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"
}

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"
    }
}

© 2025 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.