.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _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:`Matrix3` 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:`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 ---------------- - :ref:`float` **w** - :ref:`float` **x** - :ref:`float` **y** - :ref:`float` **z** Description ----------- Quaternion is a 4 dimensional vector that is used to represent a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues. Member Function Description --------------------------- .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`Vector3` axis, :ref:`float` angle **)** .. _class_Quat_Quat: - :ref:`Quat` **Quat** **(** :ref:`Matrix3` from **)** .. _class_Quat_cubic_slerp: - :ref:`Quat` **cubic_slerp** **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` t **)** .. _class_Quat_dot: - :ref:`float` **dot** **(** :ref:`Quat` b **)** Returns the dot product between two quaternions. .. _class_Quat_inverse: - :ref:`Quat` **inverse** **(** **)** Returns the inverse of the quaternion (applies to the inverse rotation too). .. _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 **)** Perform a spherical-linear interpolation with another quaternion. .. _class_Quat_slerpni: - :ref:`Quat` **slerpni** **(** :ref:`Quat` b, :ref:`float` t **)** .. _class_Quat_xform: - :ref:`Vector3` **xform** **(** :ref:`Vector3` v **)**