.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Quat.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Quat: Quat ==== **Category:** Built-In Types Brief Description ----------------- Quaternion. Member Functions ---------------- +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`Quat` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`Quat` **(** :ref:`Basis` from **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`cubic_slerp` **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` t **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`dot` **(** :ref:`Quat` b **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`inverse` **(** **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_normalized` **(** **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length` **(** **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`length_squared` **(** **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`normalized` **(** **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`slerp` **(** :ref:`Quat` b, :ref:`float` t **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Quat` | :ref:`slerpni` **(** :ref:`Quat` b, :ref:`float` t **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`xform` **(** :ref:`Vector3` v **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- .. _class_Quat_w: - :ref:`float` **w** - W component of the quaternion. Default value: ``1`` .. _class_Quat_x: - :ref:`float` **x** - X component of the quaternion. Default value: ``0`` .. _class_Quat_y: - :ref:`float` **y** - Y component of the quaternion. Default value: ``0`` .. _class_Quat_z: - :ref:`float` **z** - Z component of the quaternion. Default value: ``0`` Description ----------- A 4-dimensional vector representing a rotation. The vector represents a 4 dimensional complex number where multiplication of the basis elements is not commutative (multiplying i with j gives a different result than multiplying j with i). Multiplying quaternions reproduces rotation sequences. However quaternions need to be often renormalized, or else they suffer from precision issues. It can be used to perform SLERP (spherical-linear interpolation) between two rotations. Member Function Description --------------------------- .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** Returns a quaternion defined by these values. .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`Vector3` axis, :ref:`float` angle **)** Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`Basis` from **)** Returns the rotation matrix corresponding to the given quaternion. .. _class_Quat_cubic_slerp: - :ref:`Quat` **cubic_slerp** **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` t **)** Performs a cubic spherical-linear interpolation with another quaternion. .. _class_Quat_dot: - :ref:`float` **dot** **(** :ref:`Quat` b **)** Returns the dot product of two quaternions. .. _class_Quat_inverse: - :ref:`Quat` **inverse** **(** **)** Returns the inverse of the quaternion. .. _class_Quat_is_normalized: - :ref:`bool` **is_normalized** **(** **)** Returns whether the quaternion is normalized or not. .. _class_Quat_length: - :ref:`float` **length** **(** **)** Returns the length of the quaternion. .. _class_Quat_length_squared: - :ref:`float` **length_squared** **(** **)** Returns the length of the quaternion, squared. .. _class_Quat_normalized: - :ref:`Quat` **normalized** **(** **)** Returns a copy of the quaternion, normalized to unit length. .. _class_Quat_slerp: - :ref:`Quat` **slerp** **(** :ref:`Quat` b, :ref:`float` t **)** Performs a spherical-linear interpolation with another quaternion. .. _class_Quat_slerpni: - :ref:`Quat` **slerpni** **(** :ref:`Quat` b, :ref:`float` t **)** Performs a spherical-linear interpolation with another quaterion without checking if the rotation path is not bigger than 90°. .. _class_Quat_xform: - :ref:`Vector3` **xform** **(** :ref:`Vector3` v **)** Transforms the vector ``v`` by this quaternion.