Vector3i.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Vector3i" version="4.0">
  3. <brief_description>
  4. Vector used for 3D math using integer coordinates.
  5. </brief_description>
  6. <description>
  7. 3-element structure that can be used to represent positions in 3D space or any other pair of numeric values.
  8. It uses integer coordinates and is therefore preferable to [Vector3] when exact precision is required.
  9. [b]Note:[/b] In a boolean context, a Vector3i will evaluate to [code]false[/code] if it's equal to [code]Vector3i(0, 0, 0)[/code]. Otherwise, a Vector3i will always evaluate to [code]true[/code].
  10. </description>
  11. <tutorials>
  12. <link title="Math documentation index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
  13. <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link>
  14. <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link>
  15. </tutorials>
  16. <constructors>
  17. <constructor name="Vector3i">
  18. <return type="Vector3i" />
  19. <description>
  20. Constructs a default-initialized [Vector3i] with all components set to [code]0[/code].
  21. </description>
  22. </constructor>
  23. <constructor name="Vector3i">
  24. <return type="Vector3i" />
  25. <argument index="0" name="from" type="Vector3i" />
  26. <description>
  27. Constructs a [Vector3i] as a copy of the given [Vector3i].
  28. </description>
  29. </constructor>
  30. <constructor name="Vector3i">
  31. <return type="Vector3i" />
  32. <argument index="0" name="from" type="Vector3" />
  33. <description>
  34. Constructs a new [Vector3i] from [Vector3]. The floating point coordinates will be truncated.
  35. </description>
  36. </constructor>
  37. <constructor name="Vector3i">
  38. <return type="Vector3i" />
  39. <argument index="0" name="x" type="int" />
  40. <argument index="1" name="y" type="int" />
  41. <argument index="2" name="z" type="int" />
  42. <description>
  43. Returns a [Vector3i] with the given components.
  44. </description>
  45. </constructor>
  46. </constructors>
  47. <methods>
  48. <method name="abs" qualifiers="const">
  49. <return type="Vector3i" />
  50. <description>
  51. </description>
  52. </method>
  53. <method name="clamp" qualifiers="const">
  54. <return type="Vector3i" />
  55. <argument index="0" name="min" type="Vector3i" />
  56. <argument index="1" name="max" type="Vector3i" />
  57. <description>
  58. Returns a new vector with all components clamped between the components of [code]min[/code] and [code]max[/code], by running [method @GlobalScope.clamp] on each component.
  59. </description>
  60. </method>
  61. <method name="max_axis" qualifiers="const">
  62. <return type="int" />
  63. <description>
  64. Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_X].
  65. </description>
  66. </method>
  67. <method name="min_axis" qualifiers="const">
  68. <return type="int" />
  69. <description>
  70. Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants. If all components are equal, this method returns [constant AXIS_Z].
  71. </description>
  72. </method>
  73. <method name="sign" qualifiers="const">
  74. <return type="Vector3i" />
  75. <description>
  76. Returns the vector with each component set to one or negative one, depending on the signs of the components.
  77. </description>
  78. </method>
  79. </methods>
  80. <members>
  81. <member name="x" type="int" setter="" getter="" default="0">
  82. The vector's X component. Also accessible by using the index position [code][0][/code].
  83. </member>
  84. <member name="y" type="int" setter="" getter="" default="0">
  85. The vector's Y component. Also accessible by using the index position [code][1][/code].
  86. </member>
  87. <member name="z" type="int" setter="" getter="" default="0">
  88. The vector's Z component. Also accessible by using the index position [code][2][/code].
  89. </member>
  90. </members>
  91. <constants>
  92. <constant name="AXIS_X" value="0">
  93. Enumerated value for the X axis.
  94. </constant>
  95. <constant name="AXIS_Y" value="1">
  96. Enumerated value for the Y axis.
  97. </constant>
  98. <constant name="AXIS_Z" value="2">
  99. Enumerated value for the Z axis.
  100. </constant>
  101. <constant name="ZERO" value="Vector3i(0, 0, 0)">
  102. Zero vector, a vector with all components set to [code]0[/code].
  103. </constant>
  104. <constant name="ONE" value="Vector3i(1, 1, 1)">
  105. One vector, a vector with all components set to [code]1[/code].
  106. </constant>
  107. <constant name="LEFT" value="Vector3i(-1, 0, 0)">
  108. Left unit vector. Represents the local direction of left, and the global direction of west.
  109. </constant>
  110. <constant name="RIGHT" value="Vector3i(1, 0, 0)">
  111. Right unit vector. Represents the local direction of right, and the global direction of east.
  112. </constant>
  113. <constant name="UP" value="Vector3i(0, 1, 0)">
  114. Up unit vector.
  115. </constant>
  116. <constant name="DOWN" value="Vector3i(0, -1, 0)">
  117. Down unit vector.
  118. </constant>
  119. <constant name="FORWARD" value="Vector3i(0, 0, -1)">
  120. Forward unit vector. Represents the local direction of forward, and the global direction of north.
  121. </constant>
  122. <constant name="BACK" value="Vector3i(0, 0, 1)">
  123. Back unit vector. Represents the local direction of back, and the global direction of south.
  124. </constant>
  125. </constants>
  126. <operators>
  127. <operator name="operator !=">
  128. <return type="bool" />
  129. <description>
  130. </description>
  131. </operator>
  132. <operator name="operator !=">
  133. <return type="bool" />
  134. <argument index="0" name="right" type="Vector3i" />
  135. <description>
  136. </description>
  137. </operator>
  138. <operator name="operator %">
  139. <return type="Vector3i" />
  140. <argument index="0" name="right" type="Vector3i" />
  141. <description>
  142. </description>
  143. </operator>
  144. <operator name="operator %">
  145. <return type="Vector3i" />
  146. <argument index="0" name="right" type="int" />
  147. <description>
  148. </description>
  149. </operator>
  150. <operator name="operator *">
  151. <return type="Vector3i" />
  152. <argument index="0" name="right" type="Vector3i" />
  153. <description>
  154. </description>
  155. </operator>
  156. <operator name="operator *">
  157. <return type="Vector3i" />
  158. <argument index="0" name="right" type="float" />
  159. <description>
  160. </description>
  161. </operator>
  162. <operator name="operator *">
  163. <return type="Vector3i" />
  164. <argument index="0" name="right" type="int" />
  165. <description>
  166. </description>
  167. </operator>
  168. <operator name="operator +">
  169. <return type="Vector3i" />
  170. <argument index="0" name="right" type="Vector3i" />
  171. <description>
  172. </description>
  173. </operator>
  174. <operator name="operator -">
  175. <return type="Vector3i" />
  176. <argument index="0" name="right" type="Vector3i" />
  177. <description>
  178. </description>
  179. </operator>
  180. <operator name="operator /">
  181. <return type="Vector3i" />
  182. <argument index="0" name="right" type="Vector3i" />
  183. <description>
  184. </description>
  185. </operator>
  186. <operator name="operator /">
  187. <return type="Vector3i" />
  188. <argument index="0" name="right" type="float" />
  189. <description>
  190. </description>
  191. </operator>
  192. <operator name="operator /">
  193. <return type="Vector3i" />
  194. <argument index="0" name="right" type="int" />
  195. <description>
  196. </description>
  197. </operator>
  198. <operator name="operator &lt;">
  199. <return type="bool" />
  200. <argument index="0" name="right" type="Vector3i" />
  201. <description>
  202. </description>
  203. </operator>
  204. <operator name="operator &lt;=">
  205. <return type="bool" />
  206. <argument index="0" name="right" type="Vector3i" />
  207. <description>
  208. </description>
  209. </operator>
  210. <operator name="operator ==">
  211. <return type="bool" />
  212. <description>
  213. </description>
  214. </operator>
  215. <operator name="operator ==">
  216. <return type="bool" />
  217. <argument index="0" name="right" type="Vector3i" />
  218. <description>
  219. </description>
  220. </operator>
  221. <operator name="operator &gt;">
  222. <return type="bool" />
  223. <argument index="0" name="right" type="Vector3i" />
  224. <description>
  225. </description>
  226. </operator>
  227. <operator name="operator &gt;=">
  228. <return type="bool" />
  229. <argument index="0" name="right" type="Vector3i" />
  230. <description>
  231. </description>
  232. </operator>
  233. <operator name="operator []">
  234. <return type="int" />
  235. <argument index="0" name="index" type="int" />
  236. <description>
  237. </description>
  238. </operator>
  239. <operator name="operator unary+">
  240. <return type="Vector3i" />
  241. <description>
  242. </description>
  243. </operator>
  244. <operator name="operator unary-">
  245. <return type="Vector3i" />
  246. <description>
  247. </description>
  248. </operator>
  249. </operators>
  250. </class>