TargetDirection3D QML Type

用于指定朝向目标位置的方向。更多

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

Direction3D

属性

详细说明

该元素用于设置向目标位置发射粒子的速度。

例如,以 10...20 之间的随机幅度向位置(100, 0, 0)发射粒子:

ParticleEmitter3D {
    ...
    velocity: TargetDirection3D {
        position: Qt.vector3d(100, 0, 0)
        normalized: true
        magnitude: 15.0
        magnitudeVariation: 5.0
    }
}

属性文档

magnitude : real

该属性定义了每秒位置变化的幅度。负值加速度与position 相反。当normalized 为假时,该值将与目标位置的距离相乘。

默认值为1.0

另请参阅 magnitudeVariation


magnitudeVariation : real

该属性定义了每秒位置变化的幅度变化。当normalized 为假时,该值将与目标位置的距离相乘。

默认值为0.0

另请参阅 magnitude


normalized : bool

该属性定义了到position 的距离是否应视为归一化。设置为假时,到position 的距离会影响粒子速度的大小。设置为 true 时,距离被归一化,速度大小只来自magnitudemagnitudeVariation

默认值为false

另请参阅 magnitudemagnitudeVariation


position : vector3d

该属性定义粒子目标的位置。

默认值为(0, 0, 0) (发射器中心)。

另请参阅 positionVariation


positionVariation : vector3d

该属性定义粒子目标的位置变化。

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

另请参阅 position


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