TargetDirection3D QML Type
用于指定指向目标位置的方向。更多...
| Import Statement: | import QtQuick3D.Particles3D |
| Since: | Qt 6.2 |
| Inherits: |
属性
- magnitude : real
- magnitudeVariation : real
- normalized : bool
- position : vector3d
- positionVariation : vector3d
详细说明
此元素用于设置向目标位置发射的粒子速度。
例如,要向坐标 (100, 0, 0) 的位置发射粒子,且粒子速度的大小在 10 到 20 之间随机变化:
ParticleEmitter3D {
...
velocity: TargetDirection3D {
position: Qt.vector3d(100, 0, 0)
normalized: true
magnitude: 15.0
magnitudeVariation: 5.0
}
}属性文档
magnitude : real
该属性定义了每秒位置变化的幅度。负幅度表示与position 相反方向的加速度。当normalized 为false时,该值将与目标位置的距离相乘。
默认值为1.0 。
另请参阅 magnitudeVariation 。
magnitudeVariation : real
该属性定义了每秒位置变化的幅度变化。当normalized 为false时,该值将与目标位置的距离相乘。
默认值为0.0 。
另请参阅 magnitude 。
normalized : bool
该属性用于定义是否应将到position 的距离视为归一化距离。当该属性为 false 时,到position 的距离会影响粒子速度的大小。当设置为 true 时,距离将被归一化,速度的大小仅由magnitude 和magnitudeVariation 决定。
默认值为false 。
另请参阅 magnitude 和magnitudeVariation 。
position : vector3d
此属性定义了粒子目标的位置。
默认值为(0, 0, 0) (发射器的中心)。
另请参阅 positionVariation 。
positionVariation : vector3d
此属性定义了粒子目标的位置变化。
默认值为(0, 0, 0) (无变化)。
另请参阅 position 。
© 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.