ModelBlendParticle3D QML Type
将粒子效果与 3D 模型融合。更多
| Import Statement: | import QtQuick3D.Particles3D |
| Inherits: |
属性
- ModelBlendEmitMode : enumeration
- ModelBlendMode : enumeration
- activationNode : Node
- delegate : Component
- emitMode : bool
- endNode : Node
- endTime : int
- modelBlendMode : ModelBlendMode
详细说明
该类型提供了一种将粒子效果与 3D 模型混合的方法。所提供的模型必须以三角形为基础。模型中的每个三角形都会转换成粒子,然后由发射器使用。模型的着色器不是粒子着色器,而是使用模型中指定的material 着色。混合效果的方式由modelBlendMode 决定。
可能的模式有
- 构建:模型由粒子构建而成。
- 爆炸,模型转换成粒子。
- 转移:将 "构建 "和 "爆炸 "结合起来,创建模型从一个地方转移到另一个地方的效果。
默认情况下,粒子会按照模型中指定的顺序发射,除非emitMode 设置为Random 或emitMode 设置为Activation 以及activationNode 。
基类和发射器中定义的某些功能在此类型中不起作用:
- Particle3D::alignMode 由于粒子在模型中可以有任意的方向,因此不能使用。
- Particle3D::sortMode 由于粒子总是按照模型中指定的基元顺序渲染,因此不起作用。
- ParticleEmitter3D::depthBias 由于使用的是模型深度偏置,因此不起作用。
注: 默认的fadeInEffect 和fadeOutEffect 是Particle3D.FadeNone 。
属性文档
ModelBlendEmitMode : enumeration
定义粒子的发射模式
| 常数 | 说明 |
|---|---|
ModelBlendParticle3D.Sequential | 粒子按模型中定义的顺序发射。 |
ModelBlendParticle3D.Random | 粒子以随机顺序发射。 |
ModelBlendParticle3D.Activation | 粒子在被activationNode 激活时发射。 |
ModelBlendMode : enumeration
定义粒子效果的混合模式。
| 常数 | 说明 |
|---|---|
ModelBlendParticle3D.Explode | 模型爆炸,即粒子从模型的位置发射。 |
ModelBlendParticle3D.Construct | 构建模型,即粒子从发射器飞出并在最后构建模型。 |
ModelBlendParticle3D.Transfer | 同一模型的爆炸和转移相结合。 |
activationNode : Node
此属性包含一个激活粒子的节点,并覆盖常规的发射例程。激活节点可用于控制当模型由粒子爆炸/构建时,粒子在空间上的发射方式。如果粒子的中心位于激活节点 Z 轴的正半轴上,激活节点就会发射该粒子。激活节点在模型中移动时,会使粒子沿着激活节点移动的路径依次发射。
delegate : Component
委托提供了一个模板,定义了ModelBlendParticle3D 的模型。
例如,使用带有默认材料的默认球体模型
Component {
id: modelComponent
Model {
source: "#Sphere"
scale: Qt.vector3d(0.5, 0.5, 0.5)
materials: DefaultMaterial { diffuseColor: "red" }
}
}
ModelBlendParticle3D {
id: particleRedSphere
delegate: modelComponent
}emitMode : bool
该属性用于保存粒子的发射模式。
endNode : Node
此属性包含指定粒子效果结束时模型变换的节点。它定义了使用ModelBlendParticle3D.Construct 和ModelBlendParticle3D.Transfer 混合模式时构建模型的大小、位置和旋转。
endTime : int
此属性保存粒子的结束时间(毫秒)。结束时间在构建过程中使用,它定义了从粒子生命周期开始到粒子效果与模型位置混合后结束的持续时间。在结束时间之前,粒子的位置仅由粒子效果定义,但在结束时间内,粒子的位置会与模型的结束位置线性混合。
modelBlendMode : ModelBlendMode
此属性用于保存粒子效果的混合模式。
© 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.