本页内容

VectorDirection3D QML Type

用于指定指向目标方向的方向。更多...

Import Statement: import QtQuick3D.Particles3D
Since: Qt 6.2
Inherits:

Direction3D

属性

详细说明

此元素用于将发射粒子的速度设置为指向目标方向向量的方向。方向向量的长度将作为速度的大小。

例如,要向 x: 50..150、y: -20..20、z: 0 范围内的某个随机方向发射粒子:

ParticleEmitter3D {
    ...
    velocity: VectorDirection3D {
        direction: Qt.vector3d(100, 0, 0)
        directionVariation: Qt.vector3d(50, 20, 0)
    }
}

属性文档

direction : vector3d

此属性定义了粒子的目标方向。

默认值为(0, 100, 0) (沿y轴向上)。

另请参阅 directionVariation 。

directionVariation : vector3d

此属性定义了粒子目标的方向变化。

默认值为(0, 0, 0) (无变化)。

另请参阅 direction 。

normalized : bool

此属性用于定义在应用变异后是否对方向进行归一化处理。当该属性为 false 时,变异会影响粒子速度的大小;当设置为 true 时,变异会影响方向,但速度大小由原始方向的长度决定。

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