class_transform3d.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Transform3D.xml.
  6. .. _class_Transform3D:
  7. Transform3D
  8. ===========
  9. A 3×4 matrix representing a 3D transformation.
  10. .. rst-class:: classref-introduction-group
  11. Description
  12. -----------
  13. A 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, and scaling. It consists of a :ref:`basis<class_Transform3D_property_basis>` (first 3 columns) and a :ref:`Vector3<class_Vector3>` for the :ref:`origin<class_Transform3D_property_origin>` (last column).
  14. For a general introduction, see the :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>` tutorial.
  15. .. note::
  16. There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Math documentation index <../tutorials/math/index>`
  21. - :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>`
  22. - :doc:`Using 3D transforms <../tutorials/3d/using_transforms>`
  23. - `Matrix Transform Demo <https://godotengine.org/asset-library/asset/584>`__
  24. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
  25. - `2.5D Demo <https://godotengine.org/asset-library/asset/583>`__
  26. .. rst-class:: classref-reftable-group
  27. Properties
  28. ----------
  29. .. table::
  30. :widths: auto
  31. +-------------------------------+--------------------------------------------------+--------------------------------------+
  32. | :ref:`Basis<class_Basis>` | :ref:`basis<class_Transform3D_property_basis>` | ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)`` |
  33. +-------------------------------+--------------------------------------------------+--------------------------------------+
  34. | :ref:`Vector3<class_Vector3>` | :ref:`origin<class_Transform3D_property_origin>` | ``Vector3(0, 0, 0)`` |
  35. +-------------------------------+--------------------------------------------------+--------------------------------------+
  36. .. rst-class:: classref-reftable-group
  37. Constructors
  38. ------------
  39. .. table::
  40. :widths: auto
  41. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Transform3D<class_Transform3D>` | :ref:`Transform3D<class_Transform3D_constructor_Transform3D>` **(** **)** |
  43. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Transform3D<class_Transform3D>` | :ref:`Transform3D<class_Transform3D_constructor_Transform3D>` **(** :ref:`Transform3D<class_Transform3D>` from **)** |
  45. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Transform3D<class_Transform3D>` | :ref:`Transform3D<class_Transform3D_constructor_Transform3D>` **(** :ref:`Basis<class_Basis>` basis, :ref:`Vector3<class_Vector3>` origin **)** |
  47. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Transform3D<class_Transform3D>` | :ref:`Transform3D<class_Transform3D_constructor_Transform3D>` **(** :ref:`Projection<class_Projection>` from **)** |
  49. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Transform3D<class_Transform3D>` | :ref:`Transform3D<class_Transform3D_constructor_Transform3D>` **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis, :ref:`Vector3<class_Vector3>` origin **)** |
  51. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. .. rst-class:: classref-reftable-group
  53. Methods
  54. -------
  55. .. table::
  56. :widths: auto
  57. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Transform3D<class_Transform3D>` | :ref:`affine_inverse<class_Transform3D_method_affine_inverse>` **(** **)** |const| |
  59. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Transform3D<class_Transform3D>` | :ref:`interpolate_with<class_Transform3D_method_interpolate_with>` **(** :ref:`Transform3D<class_Transform3D>` xform, :ref:`float<class_float>` weight **)** |const| |
  61. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Transform3D<class_Transform3D>` | :ref:`inverse<class_Transform3D_method_inverse>` **(** **)** |const| |
  63. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Transform3D_method_is_equal_approx>` **(** :ref:`Transform3D<class_Transform3D>` xform **)** |const| |
  65. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`is_finite<class_Transform3D_method_is_finite>` **(** **)** |const| |
  67. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Transform3D<class_Transform3D>` | :ref:`looking_at<class_Transform3D_method_looking_at>` **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0), :ref:`bool<class_bool>` use_model_front=false **)** |const| |
  69. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Transform3D<class_Transform3D>` | :ref:`orthonormalized<class_Transform3D_method_orthonormalized>` **(** **)** |const| |
  71. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Transform3D<class_Transform3D>` | :ref:`rotated<class_Transform3D_method_rotated>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const| |
  73. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Transform3D<class_Transform3D>` | :ref:`rotated_local<class_Transform3D_method_rotated_local>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const| |
  75. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Transform3D<class_Transform3D>` | :ref:`scaled<class_Transform3D_method_scaled>` **(** :ref:`Vector3<class_Vector3>` scale **)** |const| |
  77. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Transform3D<class_Transform3D>` | :ref:`scaled_local<class_Transform3D_method_scaled_local>` **(** :ref:`Vector3<class_Vector3>` scale **)** |const| |
  79. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Transform3D<class_Transform3D>` | :ref:`translated<class_Transform3D_method_translated>` **(** :ref:`Vector3<class_Vector3>` offset **)** |const| |
  81. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Transform3D<class_Transform3D>` | :ref:`translated_local<class_Transform3D_method_translated_local>` **(** :ref:`Vector3<class_Vector3>` offset **)** |const| |
  83. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. .. rst-class:: classref-reftable-group
  85. Operators
  86. ---------
  87. .. table::
  88. :widths: auto
  89. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`operator !=<class_Transform3D_operator_neq_Transform3D>` **(** :ref:`Transform3D<class_Transform3D>` right **)** |
  91. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`AABB<class_AABB>` | :ref:`operator *<class_Transform3D_operator_mul_AABB>` **(** :ref:`AABB<class_AABB>` right **)** |
  93. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`operator *<class_Transform3D_operator_mul_PackedVector3Array>` **(** :ref:`PackedVector3Array<class_PackedVector3Array>` right **)** |
  95. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Plane<class_Plane>` | :ref:`operator *<class_Transform3D_operator_mul_Plane>` **(** :ref:`Plane<class_Plane>` right **)** |
  97. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Transform3D<class_Transform3D>` | :ref:`operator *<class_Transform3D_operator_mul_Transform3D>` **(** :ref:`Transform3D<class_Transform3D>` right **)** |
  99. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Vector3<class_Vector3>` | :ref:`operator *<class_Transform3D_operator_mul_Vector3>` **(** :ref:`Vector3<class_Vector3>` right **)** |
  101. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Transform3D<class_Transform3D>` | :ref:`operator *<class_Transform3D_operator_mul_float>` **(** :ref:`float<class_float>` right **)** |
  103. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Transform3D<class_Transform3D>` | :ref:`operator *<class_Transform3D_operator_mul_int>` **(** :ref:`int<class_int>` right **)** |
  105. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Transform3D<class_Transform3D>` | :ref:`operator /<class_Transform3D_operator_div_float>` **(** :ref:`float<class_float>` right **)** |
  107. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Transform3D<class_Transform3D>` | :ref:`operator /<class_Transform3D_operator_div_int>` **(** :ref:`int<class_int>` right **)** |
  109. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`operator ==<class_Transform3D_operator_eq_Transform3D>` **(** :ref:`Transform3D<class_Transform3D>` right **)** |
  111. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  112. .. rst-class:: classref-section-separator
  113. ----
  114. .. rst-class:: classref-descriptions-group
  115. Constants
  116. ---------
  117. .. _class_Transform3D_constant_IDENTITY:
  118. .. rst-class:: classref-constant
  119. **IDENTITY** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)``
  120. **Transform3D** with no translation, rotation or scaling applied. When applied to other data structures, :ref:`IDENTITY<class_Transform3D_constant_IDENTITY>` performs no transformation.
  121. .. _class_Transform3D_constant_FLIP_X:
  122. .. rst-class:: classref-constant
  123. **FLIP_X** = ``Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)``
  124. **Transform3D** with mirroring applied perpendicular to the YZ plane.
  125. .. _class_Transform3D_constant_FLIP_Y:
  126. .. rst-class:: classref-constant
  127. **FLIP_Y** = ``Transform3D(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0)``
  128. **Transform3D** with mirroring applied perpendicular to the XZ plane.
  129. .. _class_Transform3D_constant_FLIP_Z:
  130. .. rst-class:: classref-constant
  131. **FLIP_Z** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0)``
  132. **Transform3D** with mirroring applied perpendicular to the XY plane.
  133. .. rst-class:: classref-section-separator
  134. ----
  135. .. rst-class:: classref-descriptions-group
  136. Property Descriptions
  137. ---------------------
  138. .. _class_Transform3D_property_basis:
  139. .. rst-class:: classref-property
  140. :ref:`Basis<class_Basis>` **basis** = ``Basis(1, 0, 0, 0, 1, 0, 0, 0, 1)``
  141. The basis is a matrix containing 3 :ref:`Vector3<class_Vector3>` as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_Transform3D_property_origin:
  145. .. rst-class:: classref-property
  146. :ref:`Vector3<class_Vector3>` **origin** = ``Vector3(0, 0, 0)``
  147. The translation offset of the transform (column 3, the fourth column). Equivalent to array index ``3``.
  148. .. rst-class:: classref-section-separator
  149. ----
  150. .. rst-class:: classref-descriptions-group
  151. Constructor Descriptions
  152. ------------------------
  153. .. _class_Transform3D_constructor_Transform3D:
  154. .. rst-class:: classref-constructor
  155. :ref:`Transform3D<class_Transform3D>` **Transform3D** **(** **)**
  156. Constructs a default-initialized **Transform3D** set to :ref:`IDENTITY<class_Transform3D_constant_IDENTITY>`.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. rst-class:: classref-constructor
  160. :ref:`Transform3D<class_Transform3D>` **Transform3D** **(** :ref:`Transform3D<class_Transform3D>` from **)**
  161. Constructs a **Transform3D** as a copy of the given **Transform3D**.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. rst-class:: classref-constructor
  165. :ref:`Transform3D<class_Transform3D>` **Transform3D** **(** :ref:`Basis<class_Basis>` basis, :ref:`Vector3<class_Vector3>` origin **)**
  166. Constructs a Transform3D from a :ref:`Basis<class_Basis>` and :ref:`Vector3<class_Vector3>`.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. rst-class:: classref-constructor
  170. :ref:`Transform3D<class_Transform3D>` **Transform3D** **(** :ref:`Projection<class_Projection>` from **)**
  171. Constructs a Transform3D from a :ref:`Projection<class_Projection>` by trimming the last row of the projection matrix (``from.x.w``, ``from.y.w``, ``from.z.w``, and ``from.w.w`` are not copied over).
  172. .. rst-class:: classref-item-separator
  173. ----
  174. .. rst-class:: classref-constructor
  175. :ref:`Transform3D<class_Transform3D>` **Transform3D** **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis, :ref:`Vector3<class_Vector3>` origin **)**
  176. Constructs a Transform3D from four :ref:`Vector3<class_Vector3>` values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled).
  177. .. rst-class:: classref-section-separator
  178. ----
  179. .. rst-class:: classref-descriptions-group
  180. Method Descriptions
  181. -------------------
  182. .. _class_Transform3D_method_affine_inverse:
  183. .. rst-class:: classref-method
  184. :ref:`Transform3D<class_Transform3D>` **affine_inverse** **(** **)** |const|
  185. Returns the inverse of the transform, under the assumption that the basis is invertible (must have non-zero determinant).
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_Transform3D_method_interpolate_with:
  189. .. rst-class:: classref-method
  190. :ref:`Transform3D<class_Transform3D>` **interpolate_with** **(** :ref:`Transform3D<class_Transform3D>` xform, :ref:`float<class_float>` weight **)** |const|
  191. Returns a transform interpolated between this transform and another by a given ``weight`` (on the range of 0.0 to 1.0).
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_Transform3D_method_inverse:
  195. .. rst-class:: classref-method
  196. :ref:`Transform3D<class_Transform3D>` **inverse** **(** **)** |const|
  197. Returns the inverse of the transform, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). Use :ref:`affine_inverse<class_Transform3D_method_affine_inverse>` for non-orthonormal transforms (e.g. with scaling).
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_Transform3D_method_is_equal_approx:
  201. .. rst-class:: classref-method
  202. :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Transform3D<class_Transform3D>` xform **)** |const|
  203. Returns ``true`` if this transform and ``xform`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx<class_@GlobalScope_method_is_equal_approx>` on each component.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_Transform3D_method_is_finite:
  207. .. rst-class:: classref-method
  208. :ref:`bool<class_bool>` **is_finite** **(** **)** |const|
  209. Returns ``true`` if this transform is finite, by calling :ref:`@GlobalScope.is_finite<class_@GlobalScope_method_is_finite>` on each component.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_Transform3D_method_looking_at:
  213. .. rst-class:: classref-method
  214. :ref:`Transform3D<class_Transform3D>` **looking_at** **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0), :ref:`bool<class_bool>` use_model_front=false **)** |const|
  215. Returns a copy of the transform rotated such that the forward axis (-Z) points towards the ``target`` position.
  216. The up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the forward axis. The resulting transform is orthonormalized. The existing rotation, scale, and skew information from the original transform is discarded. The ``target`` and ``up`` vectors cannot be zero, cannot be parallel to each other, and are defined in global/parent space.
  217. If ``use_model_front`` is ``true``, the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the ``target`` position. By default, the -Z axis (camera forward) is treated as forward (implies +X is right).
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_Transform3D_method_orthonormalized:
  221. .. rst-class:: classref-method
  222. :ref:`Transform3D<class_Transform3D>` **orthonormalized** **(** **)** |const|
  223. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_Transform3D_method_rotated:
  227. .. rst-class:: classref-method
  228. :ref:`Transform3D<class_Transform3D>` **rotated** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const|
  229. Returns a copy of the transform rotated around the given ``axis`` by the given ``angle`` (in radians).
  230. The ``axis`` must be a normalized vector.
  231. This method is an optimized version of multiplying the given transform ``X`` with a corresponding rotation transform ``R`` from the left, i.e., ``R * X``.
  232. This can be seen as transforming with respect to the global/parent frame.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_Transform3D_method_rotated_local:
  236. .. rst-class:: classref-method
  237. :ref:`Transform3D<class_Transform3D>` **rotated_local** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const|
  238. Returns a copy of the transform rotated around the given ``axis`` by the given ``angle`` (in radians).
  239. The ``axis`` must be a normalized vector.
  240. This method is an optimized version of multiplying the given transform ``X`` with a corresponding rotation transform ``R`` from the right, i.e., ``X * R``.
  241. This can be seen as transforming with respect to the local frame.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_Transform3D_method_scaled:
  245. .. rst-class:: classref-method
  246. :ref:`Transform3D<class_Transform3D>` **scaled** **(** :ref:`Vector3<class_Vector3>` scale **)** |const|
  247. Returns a copy of the transform scaled by the given ``scale`` factor.
  248. This method is an optimized version of multiplying the given transform ``X`` with a corresponding scaling transform ``S`` from the left, i.e., ``S * X``.
  249. This can be seen as transforming with respect to the global/parent frame.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_Transform3D_method_scaled_local:
  253. .. rst-class:: classref-method
  254. :ref:`Transform3D<class_Transform3D>` **scaled_local** **(** :ref:`Vector3<class_Vector3>` scale **)** |const|
  255. Returns a copy of the transform scaled by the given ``scale`` factor.
  256. This method is an optimized version of multiplying the given transform ``X`` with a corresponding scaling transform ``S`` from the right, i.e., ``X * S``.
  257. This can be seen as transforming with respect to the local frame.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_Transform3D_method_translated:
  261. .. rst-class:: classref-method
  262. :ref:`Transform3D<class_Transform3D>` **translated** **(** :ref:`Vector3<class_Vector3>` offset **)** |const|
  263. Returns a copy of the transform translated by the given ``offset``.
  264. This method is an optimized version of multiplying the given transform ``X`` with a corresponding translation transform ``T`` from the left, i.e., ``T * X``.
  265. This can be seen as transforming with respect to the global/parent frame.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_Transform3D_method_translated_local:
  269. .. rst-class:: classref-method
  270. :ref:`Transform3D<class_Transform3D>` **translated_local** **(** :ref:`Vector3<class_Vector3>` offset **)** |const|
  271. Returns a copy of the transform translated by the given ``offset``.
  272. This method is an optimized version of multiplying the given transform ``X`` with a corresponding translation transform ``T`` from the right, i.e., ``X * T``.
  273. This can be seen as transforming with respect to the local frame.
  274. .. rst-class:: classref-section-separator
  275. ----
  276. .. rst-class:: classref-descriptions-group
  277. Operator Descriptions
  278. ---------------------
  279. .. _class_Transform3D_operator_neq_Transform3D:
  280. .. rst-class:: classref-operator
  281. :ref:`bool<class_bool>` **operator !=** **(** :ref:`Transform3D<class_Transform3D>` right **)**
  282. Returns ``true`` if the transforms are not equal.
  283. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Transform3D_method_is_equal_approx>` instead, which is more reliable.
  284. .. rst-class:: classref-item-separator
  285. ----
  286. .. _class_Transform3D_operator_mul_AABB:
  287. .. rst-class:: classref-operator
  288. :ref:`AABB<class_AABB>` **operator *** **(** :ref:`AABB<class_AABB>` right **)**
  289. Transforms (multiplies) the :ref:`AABB<class_AABB>` by the given **Transform3D** matrix.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_Transform3D_operator_mul_PackedVector3Array:
  293. .. rst-class:: classref-operator
  294. :ref:`PackedVector3Array<class_PackedVector3Array>` **operator *** **(** :ref:`PackedVector3Array<class_PackedVector3Array>` right **)**
  295. Transforms (multiplies) each element of the :ref:`Vector3<class_Vector3>` array by the given **Transform3D** matrix.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_Transform3D_operator_mul_Plane:
  299. .. rst-class:: classref-operator
  300. :ref:`Plane<class_Plane>` **operator *** **(** :ref:`Plane<class_Plane>` right **)**
  301. Transforms (multiplies) the :ref:`Plane<class_Plane>` by the given **Transform3D** transformation matrix.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_Transform3D_operator_mul_Transform3D:
  305. .. rst-class:: classref-operator
  306. :ref:`Transform3D<class_Transform3D>` **operator *** **(** :ref:`Transform3D<class_Transform3D>` right **)**
  307. Composes these two transformation matrices by multiplying them together. This has the effect of transforming the second transform (the child) by the first transform (the parent).
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_Transform3D_operator_mul_Vector3:
  311. .. rst-class:: classref-operator
  312. :ref:`Vector3<class_Vector3>` **operator *** **(** :ref:`Vector3<class_Vector3>` right **)**
  313. Transforms (multiplies) the :ref:`Vector3<class_Vector3>` by the given **Transform3D** matrix.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_Transform3D_operator_mul_float:
  317. .. rst-class:: classref-operator
  318. :ref:`Transform3D<class_Transform3D>` **operator *** **(** :ref:`float<class_float>` right **)**
  319. This operator multiplies all components of the **Transform3D**, including the :ref:`origin<class_Transform3D_property_origin>` vector, which scales it uniformly.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_Transform3D_operator_mul_int:
  323. .. rst-class:: classref-operator
  324. :ref:`Transform3D<class_Transform3D>` **operator *** **(** :ref:`int<class_int>` right **)**
  325. This operator multiplies all components of the **Transform3D**, including the :ref:`origin<class_Transform3D_property_origin>` vector, which scales it uniformly.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_Transform3D_operator_div_float:
  329. .. rst-class:: classref-operator
  330. :ref:`Transform3D<class_Transform3D>` **operator /** **(** :ref:`float<class_float>` right **)**
  331. This operator divides all components of the **Transform3D**, including the :ref:`origin<class_Transform3D_property_origin>` vector, which inversely scales it uniformly.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_Transform3D_operator_div_int:
  335. .. rst-class:: classref-operator
  336. :ref:`Transform3D<class_Transform3D>` **operator /** **(** :ref:`int<class_int>` right **)**
  337. This operator divides all components of the **Transform3D**, including the :ref:`origin<class_Transform3D_property_origin>` vector, which inversely scales it uniformly.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_Transform3D_operator_eq_Transform3D:
  341. .. rst-class:: classref-operator
  342. :ref:`bool<class_bool>` **operator ==** **(** :ref:`Transform3D<class_Transform3D>` right **)**
  343. Returns ``true`` if the transforms are exactly equal.
  344. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Transform3D_method_is_equal_approx>` instead, which is more reliable.
  345. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  346. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  347. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  348. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  349. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  350. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  351. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`