class_quat.rst 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Quat:
  4. Quat
  5. ====
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. Quaternion.
  10. Member Functions
  11. ----------------
  12. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`Quat<class_quat>` | :ref:`Quat<class_Quat_Quat>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z, :ref:`float<class_float>` w **)** |
  14. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Quat<class_quat>` | :ref:`Quat<class_Quat_Quat>` **(** :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` angle **)** |
  16. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Quat<class_quat>` | :ref:`Quat<class_Quat_Quat>` **(** :ref:`Matrix3<class_matrix3>` from **)** |
  18. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Quat<class_quat>` | :ref:`cubic_slerp<class_Quat_cubic_slerp>` **(** :ref:`Quat<class_quat>` b, :ref:`Quat<class_quat>` pre_a, :ref:`Quat<class_quat>` post_b, :ref:`float<class_float>` t **)** |
  20. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`dot<class_Quat_dot>` **(** :ref:`Quat<class_quat>` b **)** |
  22. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Quat<class_quat>` | :ref:`inverse<class_Quat_inverse>` **(** **)** |
  24. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`length<class_Quat_length>` **(** **)** |
  26. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`length_squared<class_Quat_length_squared>` **(** **)** |
  28. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Quat<class_quat>` | :ref:`normalized<class_Quat_normalized>` **(** **)** |
  30. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Quat<class_quat>` | :ref:`slerp<class_Quat_slerp>` **(** :ref:`Quat<class_quat>` b, :ref:`float<class_float>` t **)** |
  32. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Quat<class_quat>` | :ref:`slerpni<class_Quat_slerpni>` **(** :ref:`Quat<class_quat>` b, :ref:`float<class_float>` t **)** |
  34. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Vector3<class_vector3>` | :ref:`xform<class_Quat_xform>` **(** :ref:`Vector3<class_vector3>` v **)** |
  36. +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. Member Variables
  38. ----------------
  39. - :ref:`float<class_float>` **w**
  40. - :ref:`float<class_float>` **x**
  41. - :ref:`float<class_float>` **y**
  42. - :ref:`float<class_float>` **z**
  43. Description
  44. -----------
  45. 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. Multiplying quaternions also cheaply reproduces rotation sequences, however quaternions need to be often normalized, or else they suffer from precision issues.
  46. Member Function Description
  47. ---------------------------
  48. .. _class_Quat_Quat:
  49. - :ref:`Quat<class_quat>` **Quat** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z, :ref:`float<class_float>` w **)**
  50. .. _class_Quat_Quat:
  51. - :ref:`Quat<class_quat>` **Quat** **(** :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` angle **)**
  52. Returns a quaternion that will rotate around the given axis by the specified angle.
  53. .. _class_Quat_Quat:
  54. - :ref:`Quat<class_quat>` **Quat** **(** :ref:`Matrix3<class_matrix3>` from **)**
  55. Returns the rotation matrix corresponding to the given quaternion.
  56. .. _class_Quat_cubic_slerp:
  57. - :ref:`Quat<class_quat>` **cubic_slerp** **(** :ref:`Quat<class_quat>` b, :ref:`Quat<class_quat>` pre_a, :ref:`Quat<class_quat>` post_b, :ref:`float<class_float>` t **)**
  58. .. _class_Quat_dot:
  59. - :ref:`float<class_float>` **dot** **(** :ref:`Quat<class_quat>` b **)**
  60. Returns the dot product of two quaternions.
  61. .. _class_Quat_inverse:
  62. - :ref:`Quat<class_quat>` **inverse** **(** **)**
  63. Returns the inverse of the quaternion.
  64. .. _class_Quat_length:
  65. - :ref:`float<class_float>` **length** **(** **)**
  66. Returns the length of the quaternion.
  67. .. _class_Quat_length_squared:
  68. - :ref:`float<class_float>` **length_squared** **(** **)**
  69. Returns the length of the quaternion, squared.
  70. .. _class_Quat_normalized:
  71. - :ref:`Quat<class_quat>` **normalized** **(** **)**
  72. Returns a copy of the quaternion, normalized to unit length.
  73. .. _class_Quat_slerp:
  74. - :ref:`Quat<class_quat>` **slerp** **(** :ref:`Quat<class_quat>` b, :ref:`float<class_float>` t **)**
  75. Perform a spherical-linear interpolation with another quaternion.
  76. .. _class_Quat_slerpni:
  77. - :ref:`Quat<class_quat>` **slerpni** **(** :ref:`Quat<class_quat>` b, :ref:`float<class_float>` t **)**
  78. .. _class_Quat_xform:
  79. - :ref:`Vector3<class_vector3>` **xform** **(** :ref:`Vector3<class_vector3>` v **)**