Affector QML Type

在逻辑粒子生命周期的任何时刻对其属性进行更改。更多

Import Statement: import QtQuick.Particles
Inherits:

ParticleAffector

属性

信号

详细说明

自定义影响器可直接在 JavaScript 中操作粒子的属性。

属性文档

acceleration : StochasticDirection

受影响粒子的加速度将设置为该方向。


position : StochasticDirection

相对于ParticleSystem ,受影响粒子的位置将被设置为该方向。将方向解释为点时,可将其想象为一个箭头,基点位于ParticleSystem 的 0,0,尖端位于指定位置。


relative : bool

是否将受影响粒子的现有位置/速度/加速度添加到新的位置/速度/加速度中。

默认为 "true"。


velocity : StochasticDirection

受影响粒子的速度将设置为该方向。


信号文档

affectParticles(Array particles, real dt)

particles 是一个可直接操作的粒子对象数组。

dt 是自上次受影响以来的时间。使用 可将轨迹操作归一化为实时操作。dt

注: JavaScript 的执行速度较慢,因此不建议在大容量粒子系统中使用。

注: 相应的处理程序是onAffectParticles


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