QQuaternion::Axis Struct

struct QQuaternion::Axis

This struct was introduced in Qt 6.11.

Public Functions

QVector3D toVector3D() const

Public Variables

float x
float y
float z

Static Public Members

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

Detailed Description

A struct representing a 3D axis used to define quaternions, through three (orthonormal) axes.

The struct itself does not constrain the values of its x, y and z members, though QQuaternion functions using this type may. In particular, Axis objects need not be normalized.

This type is very similar to QVector3D, to and from which it can be readily converted, but has a narrower focus. You may call it a "strong typedef" for QVector3D.

See also QQuaternion::Axes.

Member Function Documentation

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

Constructs an Axis from v, as if by

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

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

Returns this Axis as a QVector3D, as if by

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

Member Variable Documentation

float Axis::x

Contains the x-component of the 3D axis.

float Axis::y

Contains the y-component of the 3D axis.

float Axis::z

Contains the z-component of the 3D axis.

Related Non-Members

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

Returns true if axis is degenerate, that is, equal to (0, 0, 0), allowing for a small fuzziness factor for floating-point comparisons; false otherwise.

This function was introduced in Qt 6.11.