Vector3.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Vector3" category="Built-In Types" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Vector class, which performs basic 3D vector math operations.
  5. </brief_description>
  6. <description>
  7. Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vector math operations.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="Vector3">
  15. <return type="Vector3">
  16. </return>
  17. <argument index="0" name="x" type="float">
  18. </argument>
  19. <argument index="1" name="y" type="float">
  20. </argument>
  21. <argument index="2" name="z" type="float">
  22. </argument>
  23. <description>
  24. Returns a Vector3 with the given components.
  25. </description>
  26. </method>
  27. <method name="abs">
  28. <return type="Vector3">
  29. </return>
  30. <description>
  31. Returns a new vector with all components in absolute values (i.e. positive).
  32. </description>
  33. </method>
  34. <method name="angle_to">
  35. <return type="float">
  36. </return>
  37. <argument index="0" name="to" type="Vector3">
  38. </argument>
  39. <description>
  40. Returns the vector's minimum angle to the vector [code]to[/code].
  41. </description>
  42. </method>
  43. <method name="bounce">
  44. <return type="Vector3">
  45. </return>
  46. <argument index="0" name="n" type="Vector3">
  47. </argument>
  48. <description>
  49. Bounce returns the vector "bounced off" from the given plane, specified by its normal vector.
  50. </description>
  51. </method>
  52. <method name="ceil">
  53. <return type="Vector3">
  54. </return>
  55. <description>
  56. Returns a new vector with all components rounded up.
  57. </description>
  58. </method>
  59. <method name="cross">
  60. <return type="Vector3">
  61. </return>
  62. <argument index="0" name="b" type="Vector3">
  63. </argument>
  64. <description>
  65. Returns the cross product with [code]b[/code].
  66. </description>
  67. </method>
  68. <method name="cubic_interpolate">
  69. <return type="Vector3">
  70. </return>
  71. <argument index="0" name="b" type="Vector3">
  72. </argument>
  73. <argument index="1" name="pre_a" type="Vector3">
  74. </argument>
  75. <argument index="2" name="post_b" type="Vector3">
  76. </argument>
  77. <argument index="3" name="t" type="float">
  78. </argument>
  79. <description>
  80. Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount (t).
  81. </description>
  82. </method>
  83. <method name="distance_squared_to">
  84. <return type="float">
  85. </return>
  86. <argument index="0" name="b" type="Vector3">
  87. </argument>
  88. <description>
  89. Returns the squared distance to [code]b[/code]. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
  90. </description>
  91. </method>
  92. <method name="distance_to">
  93. <return type="float">
  94. </return>
  95. <argument index="0" name="b" type="Vector3">
  96. </argument>
  97. <description>
  98. Returns the distance to b.
  99. </description>
  100. </method>
  101. <method name="dot">
  102. <return type="float">
  103. </return>
  104. <argument index="0" name="b" type="Vector3">
  105. </argument>
  106. <description>
  107. Returns the dot product with b.
  108. </description>
  109. </method>
  110. <method name="floor">
  111. <return type="Vector3">
  112. </return>
  113. <description>
  114. Returns a new vector with all components rounded down.
  115. </description>
  116. </method>
  117. <method name="inverse">
  118. <return type="Vector3">
  119. </return>
  120. <description>
  121. Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
  122. </description>
  123. </method>
  124. <method name="is_normalized">
  125. <return type="bool">
  126. </return>
  127. <description>
  128. Returns whether the vector is normalized or not.
  129. </description>
  130. </method>
  131. <method name="length">
  132. <return type="float">
  133. </return>
  134. <description>
  135. Returns the length of the vector.
  136. </description>
  137. </method>
  138. <method name="length_squared">
  139. <return type="float">
  140. </return>
  141. <description>
  142. Returns the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
  143. </description>
  144. </method>
  145. <method name="linear_interpolate">
  146. <return type="Vector3">
  147. </return>
  148. <argument index="0" name="b" type="Vector3">
  149. </argument>
  150. <argument index="1" name="t" type="float">
  151. </argument>
  152. <description>
  153. Linearly interpolates the vector to a given one (b), by the given amount (t).
  154. </description>
  155. </method>
  156. <method name="max_axis">
  157. <return type="int">
  158. </return>
  159. <description>
  160. Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
  161. </description>
  162. </method>
  163. <method name="min_axis">
  164. <return type="int">
  165. </return>
  166. <description>
  167. Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
  168. </description>
  169. </method>
  170. <method name="normalized">
  171. <return type="Vector3">
  172. </return>
  173. <description>
  174. Returns a copy of the normalized vector to unit length. This is the same as v / v.length().
  175. </description>
  176. </method>
  177. <method name="outer">
  178. <return type="Basis">
  179. </return>
  180. <argument index="0" name="b" type="Vector3">
  181. </argument>
  182. <description>
  183. Returns the outer product with b.
  184. </description>
  185. </method>
  186. <method name="reflect">
  187. <return type="Vector3">
  188. </return>
  189. <argument index="0" name="n" type="Vector3">
  190. </argument>
  191. <description>
  192. Reflects the vector along the given plane, specified by its normal vector.
  193. </description>
  194. </method>
  195. <method name="rotated">
  196. <return type="Vector3">
  197. </return>
  198. <argument index="0" name="axis" type="Vector3">
  199. </argument>
  200. <argument index="1" name="phi" type="float">
  201. </argument>
  202. <description>
  203. Rotates the vector around some axis by phi radians. The axis must be a normalized vector.
  204. </description>
  205. </method>
  206. <method name="slide">
  207. <return type="Vector3">
  208. </return>
  209. <argument index="0" name="n" type="Vector3">
  210. </argument>
  211. <description>
  212. Slide returns the component of the vector along the given plane, specified by its normal vector.
  213. </description>
  214. </method>
  215. <method name="snapped">
  216. <return type="Vector3">
  217. </return>
  218. <argument index="0" name="by" type="float">
  219. </argument>
  220. <description>
  221. Returns a copy of the vector, snapped to the lowest neared multiple.
  222. </description>
  223. </method>
  224. <method name="to_diagonal_matrix">
  225. <return type="Basis">
  226. </return>
  227. <description>
  228. Returns a diagonal matrix with the vector as main diagonal.
  229. </description>
  230. </method>
  231. </methods>
  232. <members>
  233. <member name="x" type="float" setter="" getter="">
  234. X component of the vector.
  235. </member>
  236. <member name="y" type="float" setter="" getter="">
  237. Y component of the vector.
  238. </member>
  239. <member name="z" type="float" setter="" getter="">
  240. Z component of the vector.
  241. </member>
  242. </members>
  243. <constants>
  244. <constant name="AXIS_X" value="0" enum="">
  245. Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
  246. </constant>
  247. <constant name="AXIS_Y" value="1" enum="">
  248. Enumerated value for the Y axis.
  249. </constant>
  250. <constant name="AXIS_Z" value="2" enum="">
  251. Enumerated value for the Z axis.
  252. </constant>
  253. </constants>
  254. </class>