Provides utility functions for quaternion. More...
Import Statement: | import QtQuick3D |
Since: | Qt 5.15 |
The Quaternion
is a global object with utility functions.
It is not instantiable; to use it, call the members of the global Quaternion
object directly. For example:
Node { rotation: Quaternion.fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45) }
Creates a quaternion from axis1, angle1, axis2, angle2, axis3, and angle3. Returns the resulting quaternion.
quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2) |
Creates a quaternion from axis1, angle1, axis2, and angle2. Returns the resulting quaternion.
quaternion fromAxisAndAngle(real x, real y, real z, real angle) |
Creates a quaternion from x, y, z, and angle. Returns the resulting quaternion.
quaternion fromAxisAndAngle(vector3d axis, real angle) |
Creates a quaternion from axis and angle. Returns the resulting quaternion.
quaternion fromEulerAngles(real x, real y, real z) |
Creates a quaternion from x, y, and z. Returns the resulting quaternion.
quaternion fromEulerAngles(vector3d eulerAngles) |
Creates a quaternion from eulerAngles. Returns the resulting quaternion.
quaternion lookAt(vector3d sourcePosition, vector3d targetPosition, vector3d forwardDirection, vector3d upDirection) |
Creates a quaternion from sourcePosition, targetPosition, forwardDirection, and upDirection. This is used for getting a rotation value for pointing at a particular target, and can be used to point a camera at a position in a scene.
forwardDirection defaults to Qt.vector3d(0, 0, -1)
upDirection defaults to Qt.vector3d(0, 1, 0)
Returns the resulting quaternion.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: