AABB.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AABB" version="3.2">
  3. <brief_description>
  4. Axis-Aligned Bounding Box.
  5. </brief_description>
  6. <description>
  7. AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="AABB">
  14. <return type="AABB">
  15. </return>
  16. <argument index="0" name="position" type="Vector3">
  17. </argument>
  18. <argument index="1" name="size" type="Vector3">
  19. </argument>
  20. <description>
  21. Optional constructor, accepts position and size.
  22. </description>
  23. </method>
  24. <method name="encloses">
  25. <return type="bool">
  26. </return>
  27. <argument index="0" name="with" type="AABB">
  28. </argument>
  29. <description>
  30. Returns [code]true[/code] if this [AABB] completely encloses another one.
  31. </description>
  32. </method>
  33. <method name="expand">
  34. <return type="AABB">
  35. </return>
  36. <argument index="0" name="to_point" type="Vector3">
  37. </argument>
  38. <description>
  39. Returns this [AABB] expanded to include a given point.
  40. </description>
  41. </method>
  42. <method name="get_area">
  43. <return type="float">
  44. </return>
  45. <description>
  46. Returns the volume of the [AABB].
  47. </description>
  48. </method>
  49. <method name="get_endpoint">
  50. <return type="Vector3">
  51. </return>
  52. <argument index="0" name="idx" type="int">
  53. </argument>
  54. <description>
  55. Gets the position of the 8 endpoints of the [AABB] in space.
  56. </description>
  57. </method>
  58. <method name="get_longest_axis">
  59. <return type="Vector3">
  60. </return>
  61. <description>
  62. Returns the normalized longest axis of the [AABB].
  63. </description>
  64. </method>
  65. <method name="get_longest_axis_index">
  66. <return type="int">
  67. </return>
  68. <description>
  69. Returns the index of the longest axis of the [AABB] (according to [Vector3]'s [code]AXIS_*[/code] constants).
  70. </description>
  71. </method>
  72. <method name="get_longest_axis_size">
  73. <return type="float">
  74. </return>
  75. <description>
  76. Returns the scalar length of the longest axis of the [AABB].
  77. </description>
  78. </method>
  79. <method name="get_shortest_axis">
  80. <return type="Vector3">
  81. </return>
  82. <description>
  83. Returns the normalized shortest axis of the [AABB].
  84. </description>
  85. </method>
  86. <method name="get_shortest_axis_index">
  87. <return type="int">
  88. </return>
  89. <description>
  90. Returns the index of the shortest axis of the [AABB] (according to [Vector3]::AXIS* enum).
  91. </description>
  92. </method>
  93. <method name="get_shortest_axis_size">
  94. <return type="float">
  95. </return>
  96. <description>
  97. Returns the scalar length of the shortest axis of the [AABB].
  98. </description>
  99. </method>
  100. <method name="get_support">
  101. <return type="Vector3">
  102. </return>
  103. <argument index="0" name="dir" type="Vector3">
  104. </argument>
  105. <description>
  106. Returns the support point in a given direction. This is useful for collision detection algorithms.
  107. </description>
  108. </method>
  109. <method name="grow">
  110. <return type="AABB">
  111. </return>
  112. <argument index="0" name="by" type="float">
  113. </argument>
  114. <description>
  115. Returns a copy of the [AABB] grown a given amount of units towards all the sides.
  116. </description>
  117. </method>
  118. <method name="has_no_area">
  119. <return type="bool">
  120. </return>
  121. <description>
  122. Returns [code]true[/code] if the [AABB] is flat or empty.
  123. </description>
  124. </method>
  125. <method name="has_no_surface">
  126. <return type="bool">
  127. </return>
  128. <description>
  129. Returns [code]true[/code] if the [AABB] is empty.
  130. </description>
  131. </method>
  132. <method name="has_point">
  133. <return type="bool">
  134. </return>
  135. <argument index="0" name="point" type="Vector3">
  136. </argument>
  137. <description>
  138. Returns [code]true[/code] if the [AABB] contains a point.
  139. </description>
  140. </method>
  141. <method name="intersection">
  142. <return type="AABB">
  143. </return>
  144. <argument index="0" name="with" type="AABB">
  145. </argument>
  146. <description>
  147. Returns the intersection between two [AABB]. An empty AABB (size 0,0,0) is returned on failure.
  148. </description>
  149. </method>
  150. <method name="intersects">
  151. <return type="bool">
  152. </return>
  153. <argument index="0" name="with" type="AABB">
  154. </argument>
  155. <description>
  156. Returns [code]true[/code] if the [AABB] overlaps with another.
  157. </description>
  158. </method>
  159. <method name="intersects_plane">
  160. <return type="bool">
  161. </return>
  162. <argument index="0" name="plane" type="Plane">
  163. </argument>
  164. <description>
  165. Returns [code]true[/code] if the [AABB] is on both sides of a plane.
  166. </description>
  167. </method>
  168. <method name="intersects_segment">
  169. <return type="bool">
  170. </return>
  171. <argument index="0" name="from" type="Vector3">
  172. </argument>
  173. <argument index="1" name="to" type="Vector3">
  174. </argument>
  175. <description>
  176. Returns [code]true[/code] if the [AABB] intersects the line segment between [code]from[/code] and [code]to[/code].
  177. </description>
  178. </method>
  179. <method name="is_equal_approx">
  180. <return type="bool">
  181. </return>
  182. <argument index="0" name="aabb" type="AABB">
  183. </argument>
  184. <description>
  185. Returns [code]true[/code] if this [AABB] and [code]aabb[/code] are approximately equal, by calling [method @GDScript.is_equal_approx] on each component.
  186. </description>
  187. </method>
  188. <method name="merge">
  189. <return type="AABB">
  190. </return>
  191. <argument index="0" name="with" type="AABB">
  192. </argument>
  193. <description>
  194. Returns a larger [AABB] that contains both this [AABB] and [code]with[/code].
  195. </description>
  196. </method>
  197. </methods>
  198. <members>
  199. <member name="end" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
  200. Ending corner. This is calculated as [code]position + size[/code]. Changing this property changes [member size] accordingly.
  201. </member>
  202. <member name="position" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
  203. Beginning corner.
  204. </member>
  205. <member name="size" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
  206. Size from position to end.
  207. </member>
  208. </members>
  209. <constants>
  210. </constants>
  211. </class>