ParticleSystem3D QML Type

一个包含粒子、发射器和影响器类型的系统。更多

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

Node

属性

方法

详细说明

该元素是粒子系统的根元素,用于处理系统定时,并将所有其他相关元素(如粒子、发射器和影响器)组合在一起。要对系统元素进行分组,它们需要像这样成为 ParticleSystem3D 的直接子元素:

ParticleSystem3D {
    ParticleEmitter3D {
        ...
    }
    SpriteParticle3D {
        ...
    }
}

如果系统元素不是直接子元素,则需要使用system 属性来指明它们属于哪个 ParticleSystem3D。就像这样

ParticleSystem3D {
    id: psystem
}
ParticleEmitter3D {
    system: psystem
    ...
}
SpriteParticle3D {
    system: psystem
    ...
}

属性文档

logging : bool

将此属性设为 true 可收集loggingData

注意: 此属性对性能有一定影响,因此在发布版本中不应启用。

默认值为false

另请参阅 loggingData


loggingData : ParticleSystem3DLogging [read-only]

该属性包含日志数据,在开发和优化粒子效果时非常有用。

注意: 只有当logging 设置为true 且粒子系统正在运行时,该属性才包含正确的数据。

另请参阅 logging


paused : bool

此属性定义系统当前是否暂停。如果将 paused 设为true ,粒子系统将不会推进模拟。当再次将 paused 设为false 时,模拟将从暂停的相同点重新开始。

默认值为false


running : bool

该属性定义了系统当前是否正在运行。如果 running 设置为false ,粒子系统将停止模拟。当系统再次设置为运行时,所有粒子都将被销毁。

手动修改/动画time 属性时,应将 Running 设置为false

默认值为true


seed : int

该属性定义了用于粒子随机化的种子值。使用相同的种子值,每次运行时的粒子效果都将相同。这在需要确定性行为而非随机行为时非常有用。

useRandomSeed 设置为false 时,默认值为0 ;当useRandomSeed 设置为true 时,默认值介于1..INT32_MAX 和 之间。

注意: 此属性不应在粒子动画期间修改。

另请参阅 useRandomSeed


startTime : int

该属性以毫秒为单位定义系统启动的时间。这对于预热系统,使一组粒子已经发射出去非常有用。例如,如果 startTime 设置为 2000,而系统time 的动画时间从 0 到 1000,则动画实际显示的粒子时间为 2000 到 3000 毫秒。

默认值为0


time : int

该属性以毫秒为单位定义系统的时间。

注意: 修改时间属性时,通常应将running 设置为false

下面是一个如何以半速手动循环播放 3 秒钟系统动画的示例:

ParticleSystem3D {
    running: false
    NumberAnimation on time {
        loops: Animation.Infinite
        from: 0
        to: 3000
        duration: 6000
    }
}

useRandomSeed : bool

该属性定义粒子系统的种子是随机种子还是用户自定义种子。当true 时,每次重新启动粒子系统都会为seed 生成一个新的随机值。

默认值为true

注意: 此属性不应在粒子动画期间修改。

另请参阅 seed


方法文档

reset()

此方法会将粒子系统的内部状态重置为初始状态。当running 属性为false 时,可使用此方法重置系统。当running 属性为true 时,无需调用此方法,因为系统正在管理内部状态,但当false 属性为 时,需要告知系统应在何时重置系统。


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