ParticleSystem3D QML Type
一个包含粒子、发射器和影响器类型的系统。更多
Import Statement: | import QtQuick3D.Particles3D |
Since: | Qt 6.2 |
Inherits: |
属性
- logging : bool
- loggingData : ParticleSystem3DLogging
- paused : bool
- running : bool
- seed : int
- startTime : int
- time : int
- useRandomSeed : bool
方法
- reset()
详细说明
该元素是粒子系统的根元素,用于处理系统定时,并将所有其他相关元素(如粒子、发射器和影响器)组合在一起。要对系统元素进行分组,它们需要像这样成为 ParticleSystem3D 的直接子元素:
ParticleSystem3D { ParticleEmitter3D { ... } SpriteParticle3D { ... } }
如果系统元素不是直接子元素,则需要使用system
属性来指明它们属于哪个 ParticleSystem3D。就像这样
ParticleSystem3D { id: psystem } ParticleEmitter3D { system: psystem ... } SpriteParticle3D { system: psystem ... }
属性文档
logging : bool |
loggingData : ParticleSystem3DLogging |
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 |
方法文档
reset() |
© 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.