class_transform2d.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Transform2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Transform2D:
  6. Transform2D
  7. ===========
  8. 2D transformation (2×3 matrix).
  9. Description
  10. -----------
  11. 2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of three :ref:`Vector2<class_Vector2>` values: :ref:`x<class_Transform2D_property_x>`, :ref:`y<class_Transform2D_property_y>`, and the :ref:`origin<class_Transform2D_property_origin>`.
  12. For more information, read the "Matrices and transforms" documentation article.
  13. Tutorials
  14. ---------
  15. - :doc:`Math documentation index <../tutorials/math/index>`
  16. - :doc:`Matrices and transforms <../tutorials/math/matrices_and_transforms>`
  17. - `Matrix Transform Demo <https://godotengine.org/asset-library/asset/584>`__
  18. - `2.5D Demo <https://godotengine.org/asset-library/asset/583>`__
  19. Properties
  20. ----------
  21. +-------------------------------+--------------------------------------------------+-------------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`origin<class_Transform2D_property_origin>` | ``Vector2(0, 0)`` |
  23. +-------------------------------+--------------------------------------------------+-------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`x<class_Transform2D_property_x>` | ``Vector2(1, 0)`` |
  25. +-------------------------------+--------------------------------------------------+-------------------+
  26. | :ref:`Vector2<class_Vector2>` | :ref:`y<class_Transform2D_property_y>` | ``Vector2(0, 1)`` |
  27. +-------------------------------+--------------------------------------------------+-------------------+
  28. Constructors
  29. ------------
  30. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Transform2D<class_Transform2D>` | :ref:`Transform2D<class_Transform2D_constructor_Transform2D>` **(** **)** |
  32. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Transform2D<class_Transform2D>` | :ref:`Transform2D<class_Transform2D_constructor_Transform2D>` **(** :ref:`Transform2D<class_Transform2D>` from **)** |
  34. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Transform2D<class_Transform2D>` | :ref:`Transform2D<class_Transform2D_constructor_Transform2D>` **(** :ref:`float<class_float>` rotation, :ref:`Vector2<class_Vector2>` position **)** |
  36. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Transform2D<class_Transform2D>` | :ref:`Transform2D<class_Transform2D_constructor_Transform2D>` **(** :ref:`float<class_float>` rotation, :ref:`Vector2<class_Vector2>` scale, :ref:`float<class_float>` skew, :ref:`Vector2<class_Vector2>` position **)** |
  38. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Transform2D<class_Transform2D>` | :ref:`Transform2D<class_Transform2D_constructor_Transform2D>` **(** :ref:`Vector2<class_Vector2>` x_axis, :ref:`Vector2<class_Vector2>` y_axis, :ref:`Vector2<class_Vector2>` origin **)** |
  40. +---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. Methods
  42. -------
  43. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Transform2D<class_Transform2D>` | :ref:`affine_inverse<class_Transform2D_method_affine_inverse>` **(** **)** |const| |
  45. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Vector2<class_Vector2>` | :ref:`basis_xform<class_Transform2D_method_basis_xform>` **(** :ref:`Vector2<class_Vector2>` v **)** |const| |
  47. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Vector2<class_Vector2>` | :ref:`basis_xform_inv<class_Transform2D_method_basis_xform_inv>` **(** :ref:`Vector2<class_Vector2>` v **)** |const| |
  49. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Vector2<class_Vector2>` | :ref:`get_origin<class_Transform2D_method_get_origin>` **(** **)** |const| |
  51. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`float<class_float>` | :ref:`get_rotation<class_Transform2D_method_get_rotation>` **(** **)** |const| |
  53. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Vector2<class_Vector2>` | :ref:`get_scale<class_Transform2D_method_get_scale>` **(** **)** |const| |
  55. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`get_skew<class_Transform2D_method_get_skew>` **(** **)** |const| |
  57. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Transform2D<class_Transform2D>` | :ref:`interpolate_with<class_Transform2D_method_interpolate_with>` **(** :ref:`Transform2D<class_Transform2D>` xform, :ref:`float<class_float>` weight **)** |const| |
  59. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Transform2D<class_Transform2D>` | :ref:`inverse<class_Transform2D_method_inverse>` **(** **)** |const| |
  61. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Transform2D_method_is_equal_approx>` **(** :ref:`Transform2D<class_Transform2D>` xform **)** |const| |
  63. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Transform2D<class_Transform2D>` | :ref:`looking_at<class_Transform2D_method_looking_at>` **(** :ref:`Vector2<class_Vector2>` target=Vector2(0, 0) **)** |const| |
  65. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Transform2D<class_Transform2D>` | :ref:`orthonormalized<class_Transform2D_method_orthonormalized>` **(** **)** |const| |
  67. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Transform2D<class_Transform2D>` | :ref:`rotated<class_Transform2D_method_rotated>` **(** :ref:`float<class_float>` phi **)** |const| |
  69. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Transform2D<class_Transform2D>` | :ref:`scaled<class_Transform2D_method_scaled>` **(** :ref:`Vector2<class_Vector2>` scale **)** |const| |
  71. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`set_rotation<class_Transform2D_method_set_rotation>` **(** :ref:`float<class_float>` rotation **)** |
  73. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_scale<class_Transform2D_method_set_scale>` **(** :ref:`Vector2<class_Vector2>` scale **)** |
  75. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_skew<class_Transform2D_method_set_skew>` **(** :ref:`float<class_float>` skew **)** |
  77. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Transform2D<class_Transform2D>` | :ref:`translated<class_Transform2D_method_translated>` **(** :ref:`Vector2<class_Vector2>` offset **)** |const| |
  79. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. Operators
  81. ---------
  82. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`bool<class_bool>` | :ref:`operator !=<class_Transform2D_operator_neq_bool>` **(** **)** |
  84. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`bool<class_bool>` | :ref:`operator !=<class_Transform2D_operator_neq_bool>` **(** :ref:`Transform2D<class_Transform2D>` right **)** |
  86. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`operator *<class_Transform2D_operator_mul_PackedVector2Array>` **(** :ref:`PackedVector2Array<class_PackedVector2Array>` right **)** |
  88. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Rect2<class_Rect2>` | :ref:`operator *<class_Transform2D_operator_mul_Rect2>` **(** :ref:`Rect2<class_Rect2>` right **)** |
  90. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Transform2D<class_Transform2D>` | :ref:`operator *<class_Transform2D_operator_mul_Transform2D>` **(** :ref:`Transform2D<class_Transform2D>` right **)** |
  92. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`Vector2<class_Vector2>` | :ref:`operator *<class_Transform2D_operator_mul_Vector2>` **(** :ref:`Vector2<class_Vector2>` right **)** |
  94. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`Transform2D<class_Transform2D>` | :ref:`operator *<class_Transform2D_operator_mul_Transform2D>` **(** :ref:`float<class_float>` right **)** |
  96. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`Transform2D<class_Transform2D>` | :ref:`operator *<class_Transform2D_operator_mul_Transform2D>` **(** :ref:`int<class_int>` right **)** |
  98. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`bool<class_bool>` | :ref:`operator ==<class_Transform2D_operator_eq_bool>` **(** **)** |
  100. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`bool<class_bool>` | :ref:`operator ==<class_Transform2D_operator_eq_bool>` **(** :ref:`Transform2D<class_Transform2D>` right **)** |
  102. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`Vector2<class_Vector2>` | :ref:`operator []<class_Transform2D_operator_idx_Vector2>` **(** :ref:`int<class_int>` index **)** |
  104. +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  105. Constants
  106. ---------
  107. .. _class_Transform2D_constant_IDENTITY:
  108. .. _class_Transform2D_constant_FLIP_X:
  109. .. _class_Transform2D_constant_FLIP_Y:
  110. - **IDENTITY** = **Transform2D(1, 0, 0, 1, 0, 0)** --- The identity ``Transform2D`` with no translation, rotation or scaling applied. When applied to other data structures, :ref:`IDENTITY<class_Transform2D_constant_IDENTITY>` performs no transformation.
  111. - **FLIP_X** = **Transform2D(-1, 0, 0, 1, 0, 0)** --- The ``Transform2D`` that will flip something along the X axis.
  112. - **FLIP_Y** = **Transform2D(1, 0, 0, -1, 0, 0)** --- The ``Transform2D`` that will flip something along the Y axis.
  113. Property Descriptions
  114. ---------------------
  115. .. _class_Transform2D_property_origin:
  116. - :ref:`Vector2<class_Vector2>` **origin**
  117. +-----------+-------------------+
  118. | *Default* | ``Vector2(0, 0)`` |
  119. +-----------+-------------------+
  120. The origin vector (column 2, the third column). Equivalent to array index ``2``. The origin vector represents translation.
  121. ----
  122. .. _class_Transform2D_property_x:
  123. - :ref:`Vector2<class_Vector2>` **x**
  124. +-----------+-------------------+
  125. | *Default* | ``Vector2(1, 0)`` |
  126. +-----------+-------------------+
  127. The basis matrix's X vector (column 0). Equivalent to array index ``0``.
  128. ----
  129. .. _class_Transform2D_property_y:
  130. - :ref:`Vector2<class_Vector2>` **y**
  131. +-----------+-------------------+
  132. | *Default* | ``Vector2(0, 1)`` |
  133. +-----------+-------------------+
  134. The basis matrix's Y vector (column 1). Equivalent to array index ``1``.
  135. Constructor Descriptions
  136. ------------------------
  137. .. _class_Transform2D_constructor_Transform2D:
  138. - :ref:`Transform2D<class_Transform2D>` **Transform2D** **(** **)**
  139. Constructs a default-initialized ``Transform2D`` set to :ref:`IDENTITY<class_Transform2D_constant_IDENTITY>`.
  140. ----
  141. - :ref:`Transform2D<class_Transform2D>` **Transform2D** **(** :ref:`Transform2D<class_Transform2D>` from **)**
  142. Constructs a ``Transform2D`` as a copy of the given ``Transform2D``.
  143. ----
  144. - :ref:`Transform2D<class_Transform2D>` **Transform2D** **(** :ref:`float<class_float>` rotation, :ref:`Vector2<class_Vector2>` position **)**
  145. Constructs the transform from a given angle (in radians) and position.
  146. ----
  147. - :ref:`Transform2D<class_Transform2D>` **Transform2D** **(** :ref:`float<class_float>` rotation, :ref:`Vector2<class_Vector2>` scale, :ref:`float<class_float>` skew, :ref:`Vector2<class_Vector2>` position **)**
  148. Constructs the transform from a given angle (in radians), scale, skew (in radians) and position.
  149. ----
  150. - :ref:`Transform2D<class_Transform2D>` **Transform2D** **(** :ref:`Vector2<class_Vector2>` x_axis, :ref:`Vector2<class_Vector2>` y_axis, :ref:`Vector2<class_Vector2>` origin **)**
  151. Constructs the transform from 3 :ref:`Vector2<class_Vector2>` values representing :ref:`x<class_Transform2D_property_x>`, :ref:`y<class_Transform2D_property_y>`, and the :ref:`origin<class_Transform2D_property_origin>` (the three column vectors).
  152. Method Descriptions
  153. -------------------
  154. .. _class_Transform2D_method_affine_inverse:
  155. - :ref:`Transform2D<class_Transform2D>` **affine_inverse** **(** **)** |const|
  156. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
  157. ----
  158. .. _class_Transform2D_method_basis_xform:
  159. - :ref:`Vector2<class_Vector2>` **basis_xform** **(** :ref:`Vector2<class_Vector2>` v **)** |const|
  160. Returns a vector transformed (multiplied) by the basis matrix.
  161. This method does not account for translation (the origin vector).
  162. ----
  163. .. _class_Transform2D_method_basis_xform_inv:
  164. - :ref:`Vector2<class_Vector2>` **basis_xform_inv** **(** :ref:`Vector2<class_Vector2>` v **)** |const|
  165. Returns a vector transformed (multiplied) by the inverse basis matrix.
  166. This method does not account for translation (the origin vector).
  167. ----
  168. .. _class_Transform2D_method_get_origin:
  169. - :ref:`Vector2<class_Vector2>` **get_origin** **(** **)** |const|
  170. Returns the transform's origin (translation).
  171. ----
  172. .. _class_Transform2D_method_get_rotation:
  173. - :ref:`float<class_float>` **get_rotation** **(** **)** |const|
  174. Returns the transform's rotation (in radians).
  175. ----
  176. .. _class_Transform2D_method_get_scale:
  177. - :ref:`Vector2<class_Vector2>` **get_scale** **(** **)** |const|
  178. Returns the scale.
  179. ----
  180. .. _class_Transform2D_method_get_skew:
  181. - :ref:`float<class_float>` **get_skew** **(** **)** |const|
  182. Returns the transform's skew (in radians).
  183. ----
  184. .. _class_Transform2D_method_interpolate_with:
  185. - :ref:`Transform2D<class_Transform2D>` **interpolate_with** **(** :ref:`Transform2D<class_Transform2D>` xform, :ref:`float<class_float>` weight **)** |const|
  186. Returns a transform interpolated between this transform and another by a given ``weight`` (on the range of 0.0 to 1.0).
  187. ----
  188. .. _class_Transform2D_method_inverse:
  189. - :ref:`Transform2D<class_Transform2D>` **inverse** **(** **)** |const|
  190. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use :ref:`affine_inverse<class_Transform2D_method_affine_inverse>` for transforms with scaling).
  191. ----
  192. .. _class_Transform2D_method_is_equal_approx:
  193. - :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Transform2D<class_Transform2D>` xform **)** |const|
  194. Returns ``true`` if this transform and ``transform`` are approximately equal, by calling ``is_equal_approx`` on each component.
  195. ----
  196. .. _class_Transform2D_method_looking_at:
  197. - :ref:`Transform2D<class_Transform2D>` **looking_at** **(** :ref:`Vector2<class_Vector2>` target=Vector2(0, 0) **)** |const|
  198. Returns a copy of the transform rotated such that it's rotation on the X-axis points towards the ``target`` position.
  199. Operations take place in global space.
  200. ----
  201. .. _class_Transform2D_method_orthonormalized:
  202. - :ref:`Transform2D<class_Transform2D>` **orthonormalized** **(** **)** |const|
  203. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1).
  204. ----
  205. .. _class_Transform2D_method_rotated:
  206. - :ref:`Transform2D<class_Transform2D>` **rotated** **(** :ref:`float<class_float>` phi **)** |const|
  207. Rotates the transform by the given angle (in radians), using matrix multiplication.
  208. ----
  209. .. _class_Transform2D_method_scaled:
  210. - :ref:`Transform2D<class_Transform2D>` **scaled** **(** :ref:`Vector2<class_Vector2>` scale **)** |const|
  211. Scales the transform by the given scale factor, using matrix multiplication.
  212. ----
  213. .. _class_Transform2D_method_set_rotation:
  214. - void **set_rotation** **(** :ref:`float<class_float>` rotation **)**
  215. Sets the transform's rotation (in radians).
  216. ----
  217. .. _class_Transform2D_method_set_scale:
  218. - void **set_scale** **(** :ref:`Vector2<class_Vector2>` scale **)**
  219. Sets the transform's scale.
  220. ----
  221. .. _class_Transform2D_method_set_skew:
  222. - void **set_skew** **(** :ref:`float<class_float>` skew **)**
  223. Sets the transform's skew (in radians).
  224. ----
  225. .. _class_Transform2D_method_translated:
  226. - :ref:`Transform2D<class_Transform2D>` **translated** **(** :ref:`Vector2<class_Vector2>` offset **)** |const|
  227. Translates the transform by the given offset, relative to the transform's basis vectors.
  228. Unlike :ref:`rotated<class_Transform2D_method_rotated>` and :ref:`scaled<class_Transform2D_method_scaled>`, this does not use matrix multiplication.
  229. Operator Descriptions
  230. ---------------------
  231. .. _class_Transform2D_operator_neq_bool:
  232. - :ref:`bool<class_bool>` **operator !=** **(** **)**
  233. ----
  234. - :ref:`bool<class_bool>` **operator !=** **(** :ref:`Transform2D<class_Transform2D>` right **)**
  235. Returns ``true`` if the transforms are not equal.
  236. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Transform2D_method_is_equal_approx>` instead, which is more reliable.
  237. ----
  238. .. _class_Transform2D_operator_mul_PackedVector2Array:
  239. - :ref:`PackedVector2Array<class_PackedVector2Array>` **operator *** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` right **)**
  240. Transforms (multiplies) each element of the :ref:`Vector2<class_Vector2>` array by the given ``Transform2D`` matrix.
  241. ----
  242. - :ref:`Rect2<class_Rect2>` **operator *** **(** :ref:`Rect2<class_Rect2>` right **)**
  243. Transforms (multiplies) the :ref:`Rect2<class_Rect2>` by the given ``Transform2D`` matrix.
  244. ----
  245. - :ref:`Transform2D<class_Transform2D>` **operator *** **(** :ref:`Transform2D<class_Transform2D>` right **)**
  246. 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).
  247. ----
  248. - :ref:`Vector2<class_Vector2>` **operator *** **(** :ref:`Vector2<class_Vector2>` right **)**
  249. Transforms (multiplies) the :ref:`Vector2<class_Vector2>` by the given ``Transform2D`` matrix.
  250. ----
  251. - :ref:`Transform2D<class_Transform2D>` **operator *** **(** :ref:`float<class_float>` right **)**
  252. This operator multiplies all components of the ``Transform2D``, including the origin vector, which scales it uniformly.
  253. ----
  254. - :ref:`Transform2D<class_Transform2D>` **operator *** **(** :ref:`int<class_int>` right **)**
  255. This operator multiplies all components of the ``Transform2D``, including the origin vector, which scales it uniformly.
  256. ----
  257. .. _class_Transform2D_operator_eq_bool:
  258. - :ref:`bool<class_bool>` **operator ==** **(** **)**
  259. ----
  260. - :ref:`bool<class_bool>` **operator ==** **(** :ref:`Transform2D<class_Transform2D>` right **)**
  261. Returns ``true`` if the transforms are exactly equal.
  262. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Transform2D_method_is_equal_approx>` instead, which is more reliable.
  263. ----
  264. .. _class_Transform2D_operator_idx_Vector2:
  265. - :ref:`Vector2<class_Vector2>` **operator []** **(** :ref:`int<class_int>` index **)**
  266. Access transform components using their index. ``t[0]`` is equivalent to ``t.x``, ``t[1]`` is equivalent to ``t.y``, and ``t[2]`` is equivalent to ``t.origin``.
  267. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  268. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  269. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  270. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  271. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  272. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`