Affector QML Type
在逻辑粒子的生命周期内任何时刻对其属性进行修改。更多...
| Import Statement: | import QtQuick.Particles |
| Inherits: |
属性
- acceleration : StochasticDirection
- position : StochasticDirection
- relative : bool
- velocity : StochasticDirection
信号
- affectParticles(Array particles, real dt)
详细说明
自定义影响器可在 JavaScript 中直接操控粒子的属性。
属性文档
acceleration : StochasticDirection
受影响粒子的加速度将被设置为该方向。
position : StochasticDirection
受影响的粒子将相对于ParticleSystem ,其位置被设置为该方向。在将方向解释为点时,可以将其想象成一支箭,箭根位于ParticleSystem 的(0,0)点,箭头指向指定位置所在处。
relative : bool
是否将受影响粒子的现有位置/速度/加速度与新位置/速度/加速度相加。
默认值为 true。
velocity : StochasticDirection
受影响的粒子将按此方向设定其速度。
信号文档
affectParticles(Array particles, real dt)
当选中要受影响的粒子时,会触发此信号。particles 是一个粒子对象数组,可直接对其进行操作。
dt 表示自上次受到影响以来经过的时间。请使用 `dt ` 将轨迹操作标准化为实时操作。
注意:JavaScript 的 执行速度较慢,因此不建议在高密度粒子系统中使用此功能。
注意: 对应的处理程序 是onAffectParticles 。
© 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.