在本页

QQuaternion::Axis Struct

struct QQuaternion::Axis

此结构在 Qt 6.11 中引入。

公共函数

QVector3D toVector3D() const

公共变量

float x
float y
float z

静态公共成员

QQuaternion::Axis fromVector3D(QVector3D v)
(since 6.11) bool qFuzzyIsNull(QQuaternion::Axis axis)

详细说明

代表三维轴的结构体,用于定义quaternions, 至three (orthonormal) axes

该结构体本身并不限制其xyz 成员的值,但使用该类型的QQuaternion 函数可能会限制其值。尤其是,轴对象不需要规范化。

该类型与QVector3D 非常相似,可以很容易地进行转换,但侧重点更窄。您可以将其称为QVector3D 的 "强类型定义"。

另请参见 QQuaternion::Axes

成员函数文档

[static constexpr noexcept] QQuaternion::Axis Axis::fromVector3D(QVector3D v)

v 中构造一个轴,就像通过

return Axis{v.x(), v.y(), v.z()}}

[constexpr noexcept] QVector3D Axis::toVector3D() const

QVector3D 的形式返回此坐标轴,如同通过

Axis a = *this;
return QVector3D{a.x, a.y, a.z}

成员变量文档

float Axis::x

包含 3D 轴的 x 分量。

float Axis::y

包含 3D 轴的 y 分量。

float Axis::z

包含 3D 轴的 Z 分量。

相关非成员

[noexcept, since 6.11] bool qFuzzyIsNull(QQuaternion::Axis axis)

如果axis 是退化的,即等于(0, 0, 0) ,则返回true ,允许浮点比较有一个小的模糊系数;否则返回false

此函数在 Qt 6.11 中引入。

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