QuaternionAnimation QML Type | Qt Quick 3D | Qt 6.10.2
Description: A PropertyAnimation for quaternions.

- Qt 6.10
- Qt Quick 3D
- QML Types
- QuaternionAnimation
- Qt Quick 3D | Commercial or GPLv3

# QuaternionAnimation QML Type

A PropertyAnimation for quaternions. More...

Import Statement: | `import QtQuick3D`

- List of all members, including inherited members

## Properties

- from : quaternion
- fromXRotation : real
- fromYRotation : real
- fromZRotation : real
- to : quaternion
- toXRotation : real
- toYRotation : real
- toZRotation : real
- type : enumeration

## Detailed Description

A specialized PropertyAnimation that defines an animation between two quaternions.

By default spherical linear interpolation is used. This can be changed to the faster but less accurate normalized linear interpolation by setting the type property.

Instead of specifying quaternions directly in the from and to properties, it is also possible to provide euler angles in degrees in the fromXRotation, toXRotation, fromYRotation, toYRotation, fromZRotation, toZRotation properties.

Note: Avoid mixing the quaternion and euler angle-based properties. The from and to values are expected to be fully specified either via a quaternion or the three euler angles.

See also Animation and Transitions in Qt Quick, QQuaternion, QQuaternion::slerp(), and QQuaternion::nlerp().

## Property Documentation

from : quaternion

This property holds the starting value for the animation.

fromXRotation : real

This property holds the starting value of the animation for the X axis as an euler angle in degrees.

fromYRotation : real

This property holds the starting value of the animation for the Y axis as an euler angle in degrees.

fromZRotation : real

This property holds the starting value of the animation for the Z axis as an euler angle in degrees.

to : quaternion

This property holds the ending value for the animation.

toXRotation : real

This property holds the ending value of the animation for the X axis as an euler angle in degrees.

toYRotation : real

This property holds the ending value of the animation for the Y axis as an euler angle in degrees.

toZRotation : real

This property holds the ending value of the animation for the Z axis as an euler angle in degrees.

type : enumeration

This property defines the interpolation mode.

Constant | Description
--- | ---
`QuaternionAnimation.Slerp` | Spherical linear interpolation.
`QuaternionAnimation.Nlerp` | Normalized linear interpolation.