2
0

AABB.xml 5.7 KB

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