在本页

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

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

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

默认值为true

seed : int

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

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

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

另请参阅 useRandomSeed

startTime : int

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

默认值为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

方法文档

void reset()

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

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