.. 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:`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 ---------------- - :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 two rotations. Multiplying quaternions also cheaply reproduces rotation sequences. However quaternions need to be often renormalized, 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 **)** 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 **)** .. _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 **)** 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 **)**