2
0

class_transform.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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_Transform:
  4. Transform
  5. =========
  6. **Category:** Built-In Types
  7. Brief Description
  8. -----------------
  9. 3D Transformation.
  10. Member Functions
  11. ----------------
  12. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  13. | :ref:`Transform<class_transform>` | :ref:`Transform<class_Transform_Transform>` **(** :ref:`Vector3<class_vector3>` x_axis, :ref:`Vector3<class_vector3>` y_axis, :ref:`Vector3<class_vector3>` z_axis, :ref:`Vector3<class_vector3>` origin **)** |
  14. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Transform<class_transform>` | :ref:`Transform<class_Transform_Transform>` **(** :ref:`Matrix3<class_matrix3>` basis, :ref:`Vector3<class_vector3>` origin **)** |
  16. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Transform<class_transform>` | :ref:`Transform<class_Transform_Transform>` **(** :ref:`Matrix32<class_matrix32>` from **)** |
  18. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Transform<class_transform>` | :ref:`Transform<class_Transform_Transform>` **(** :ref:`Quat<class_quat>` from **)** |
  20. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Transform<class_transform>` | :ref:`Transform<class_Transform_Transform>` **(** :ref:`Matrix3<class_matrix3>` from **)** |
  22. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Transform<class_transform>` | :ref:`affine_inverse<class_Transform_affine_inverse>` **(** **)** |
  24. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Transform<class_transform>` | :ref:`inverse<class_Transform_inverse>` **(** **)** |
  26. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Transform<class_transform>` | :ref:`looking_at<class_Transform_looking_at>` **(** :ref:`Vector3<class_vector3>` target, :ref:`Vector3<class_vector3>` up **)** |
  28. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Transform<class_transform>` | :ref:`orthonormalized<class_Transform_orthonormalized>` **(** **)** |
  30. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Transform<class_transform>` | :ref:`rotated<class_Transform_rotated>` **(** :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` phi **)** |
  32. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Transform<class_transform>` | :ref:`scaled<class_Transform_scaled>` **(** :ref:`Vector3<class_vector3>` scale **)** |
  34. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Transform<class_transform>` | :ref:`translated<class_Transform_translated>` **(** :ref:`Vector3<class_vector3>` ofs **)** |
  36. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | var | :ref:`xform<class_Transform_xform>` **(** var v **)** |
  38. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | var | :ref:`xform_inv<class_Transform_xform_inv>` **(** var v **)** |
  40. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. Member Variables
  42. ----------------
  43. - :ref:`Matrix3<class_matrix3>` **basis** - The basis contains 3 [Vector3]. X axis, Y axis, and Z axis.
  44. - :ref:`Vector3<class_vector3>` **origin** - The origin of the transform. Which is the translation offset.
  45. Description
  46. -----------
  47. Transform is used to store transformations, including translations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix.
  48. Member Function Description
  49. ---------------------------
  50. .. _class_Transform_Transform:
  51. - :ref:`Transform<class_transform>` **Transform** **(** :ref:`Vector3<class_vector3>` x_axis, :ref:`Vector3<class_vector3>` y_axis, :ref:`Vector3<class_vector3>` z_axis, :ref:`Vector3<class_vector3>` origin **)**
  52. Construct the Transform from four Vector3. Each axis creates the basis.
  53. .. _class_Transform_Transform:
  54. - :ref:`Transform<class_transform>` **Transform** **(** :ref:`Matrix3<class_matrix3>` basis, :ref:`Vector3<class_vector3>` origin **)**
  55. Construct the Transform from a Matrix3 and Vector3.
  56. .. _class_Transform_Transform:
  57. - :ref:`Transform<class_transform>` **Transform** **(** :ref:`Matrix32<class_matrix32>` from **)**
  58. Construct the Transform from a Matrix32.
  59. .. _class_Transform_Transform:
  60. - :ref:`Transform<class_transform>` **Transform** **(** :ref:`Quat<class_quat>` from **)**
  61. Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0)
  62. .. _class_Transform_Transform:
  63. - :ref:`Transform<class_transform>` **Transform** **(** :ref:`Matrix3<class_matrix3>` from **)**
  64. Construct the Transform from a Matrix3. The origin will be Vector3(0, 0, 0)
  65. .. _class_Transform_affine_inverse:
  66. - :ref:`Transform<class_transform>` **affine_inverse** **(** **)**
  67. Returns the inverse of the transfrom, even if the transform has scale or the axis vectors are not orthogonal.
  68. .. _class_Transform_inverse:
  69. - :ref:`Transform<class_transform>` **inverse** **(** **)**
  70. Returns the inverse of the transform.
  71. .. _class_Transform_looking_at:
  72. - :ref:`Transform<class_transform>` **looking_at** **(** :ref:`Vector3<class_vector3>` target, :ref:`Vector3<class_vector3>` up **)**
  73. Rotate the transform around the up vector to face the target.
  74. .. _class_Transform_orthonormalized:
  75. - :ref:`Transform<class_transform>` **orthonormalized** **(** **)**
  76. Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.
  77. .. _class_Transform_rotated:
  78. - :ref:`Transform<class_transform>` **rotated** **(** :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` phi **)**
  79. Rotate the transform locally.
  80. .. _class_Transform_scaled:
  81. - :ref:`Transform<class_transform>` **scaled** **(** :ref:`Vector3<class_vector3>` scale **)**
  82. Scale the transform locally.
  83. .. _class_Transform_translated:
  84. - :ref:`Transform<class_transform>` **translated** **(** :ref:`Vector3<class_vector3>` ofs **)**
  85. Translate the transform locally.
  86. .. _class_Transform_xform:
  87. - var **xform** **(** var v **)**
  88. Transforms vector "v" by this transform.
  89. .. _class_Transform_xform_inv:
  90. - var **xform_inv** **(** var v **)**
  91. Inverse-transforms vector "v" by this transform.