Transform.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Transform" category="Built-In Types" version="3.1">
  3. <brief_description>
  4. 3D Transformation. 3x4 matrix.
  5. </brief_description>
  6. <description>
  7. Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [Basis] "basis" and an [Vector3] "origin". It is similar to a 3x4 matrix.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
  11. <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. <method name="Transform">
  17. <return type="Transform">
  18. </return>
  19. <argument index="0" name="x_axis" type="Vector3">
  20. </argument>
  21. <argument index="1" name="y_axis" type="Vector3">
  22. </argument>
  23. <argument index="2" name="z_axis" type="Vector3">
  24. </argument>
  25. <argument index="3" name="origin" type="Vector3">
  26. </argument>
  27. <description>
  28. Constructs the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled).
  29. </description>
  30. </method>
  31. <method name="Transform">
  32. <return type="Transform">
  33. </return>
  34. <argument index="0" name="basis" type="Basis">
  35. </argument>
  36. <argument index="1" name="origin" type="Vector3">
  37. </argument>
  38. <description>
  39. Constructs the Transform from a [Basis] and [Vector3].
  40. </description>
  41. </method>
  42. <method name="Transform">
  43. <return type="Transform">
  44. </return>
  45. <argument index="0" name="from" type="Transform2D">
  46. </argument>
  47. <description>
  48. Constructs the Transform from a [Transform2D].
  49. </description>
  50. </method>
  51. <method name="Transform">
  52. <return type="Transform">
  53. </return>
  54. <argument index="0" name="from" type="Quat">
  55. </argument>
  56. <description>
  57. Constructs the Transform from a [Quat]. The origin will be Vector3(0, 0, 0).
  58. </description>
  59. </method>
  60. <method name="Transform">
  61. <return type="Transform">
  62. </return>
  63. <argument index="0" name="from" type="Basis">
  64. </argument>
  65. <description>
  66. Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0).
  67. </description>
  68. </method>
  69. <method name="affine_inverse">
  70. <return type="Transform">
  71. </return>
  72. <description>
  73. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
  74. </description>
  75. </method>
  76. <method name="interpolate_with">
  77. <return type="Transform">
  78. </return>
  79. <argument index="0" name="transform" type="Transform">
  80. </argument>
  81. <argument index="1" name="weight" type="float">
  82. </argument>
  83. <description>
  84. Interpolates the transform to other Transform by weight amount (0-1).
  85. </description>
  86. </method>
  87. <method name="inverse">
  88. <return type="Transform">
  89. </return>
  90. <description>
  91. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
  92. </description>
  93. </method>
  94. <method name="looking_at">
  95. <return type="Transform">
  96. </return>
  97. <argument index="0" name="target" type="Vector3">
  98. </argument>
  99. <argument index="1" name="up" type="Vector3">
  100. </argument>
  101. <description>
  102. Returns a copy of the transform rotated such that its -Z axis points towards the [code]target[/code] position.
  103. The transform will first be rotated around the given [code]up[/code] vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the [code]target[/code] and [code]up[/code] vectors.
  104. Operations take place in global space.
  105. </description>
  106. </method>
  107. <method name="orthonormalized">
  108. <return type="Transform">
  109. </return>
  110. <description>
  111. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
  112. </description>
  113. </method>
  114. <method name="rotated">
  115. <return type="Transform">
  116. </return>
  117. <argument index="0" name="axis" type="Vector3">
  118. </argument>
  119. <argument index="1" name="phi" type="float">
  120. </argument>
  121. <description>
  122. Rotates the transform around given axis by phi. The axis must be a normalized vector.
  123. </description>
  124. </method>
  125. <method name="scaled">
  126. <return type="Transform">
  127. </return>
  128. <argument index="0" name="scale" type="Vector3">
  129. </argument>
  130. <description>
  131. Scales the transform by the specified 3D scaling factors.
  132. </description>
  133. </method>
  134. <method name="translated">
  135. <return type="Transform">
  136. </return>
  137. <argument index="0" name="ofs" type="Vector3">
  138. </argument>
  139. <description>
  140. Translates the transform by the specified offset.
  141. </description>
  142. </method>
  143. <method name="xform">
  144. <return type="Variant">
  145. </return>
  146. <argument index="0" name="v" type="Variant">
  147. </argument>
  148. <description>
  149. Transforms the given [Vector3], [Plane], or [AABB] by this transform.
  150. </description>
  151. </method>
  152. <method name="xform_inv">
  153. <return type="Variant">
  154. </return>
  155. <argument index="0" name="v" type="Variant">
  156. </argument>
  157. <description>
  158. Inverse-transforms the given [Vector3], [Plane], or [AABB] by this transform.
  159. </description>
  160. </method>
  161. </methods>
  162. <members>
  163. <member name="basis" type="Basis" setter="" getter="">
  164. The basis is a matrix containing 3 [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.
  165. </member>
  166. <member name="origin" type="Vector3" setter="" getter="">
  167. The translation offset of the transform.
  168. </member>
  169. </members>
  170. <constants>
  171. <constant name="IDENTITY" value="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
  172. </constant>
  173. <constant name="FLIP_X" value="Transform( -1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
  174. </constant>
  175. <constant name="FLIP_Y" value="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
  176. </constant>
  177. <constant name="FLIP_Z" value="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
  178. </constant>
  179. </constants>
  180. </class>