ModelBlendParticle3D QML Type

将粒子效果与 3D 模型融合。更多

Import Statement: import QtQuick3D.Particles3D
Inherits:

Particle3D

属性

详细说明

该类型提供了一种将粒子效果与 3D 模型混合的方法。所提供的模型必须以三角形为基础。模型中的每个三角形都会转换成粒子,然后由发射器使用。模型的着色器不是粒子着色器,而是使用模型中指定的material 着色。混合效果的方式由modelBlendMode 决定。

可能的模式有

  • 构建:模型由粒子构建而成。
  • 爆炸,模型转换成粒子。
  • 转移:将 "构建 "和 "爆炸 "结合在一起,创建模型从一个地方转移到另一个地方的效果。

默认情况下,粒子会按照模型中指定的顺序发射,除非emitMode 设置为RandomemitMode 设置为Activation 以及activationNode

基类和发射器中定义的某些功能在此类型中不起作用:

注: 默认的fadeInEffectfadeOutEffectParticle3D.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.ConstructModelBlendParticle3D.Transfer 混合模式时构建模型的大小、位置和旋转。


endTime : int

该属性包含粒子的结束时间(以毫秒为单位)。结束时间在构建过程中使用,它定义了从粒子生命周期到效果与模型位置混合结束的持续时间。在结束时间之前,粒子的位置仅由粒子效果定义,但在结束时间内,粒子的位置会与模型的结束位置线性混合。


modelBlendMode : ModelBlendMode

此属性用于保存粒子效果的混合模式。


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