class_rect3.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Rect3.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Rect3:
  5. Rect3
  6. =====
  7. **Category:** Built-In Types
  8. Brief Description
  9. -----------------
  10. Axis-Aligned Bounding Box.
  11. Member Functions
  12. ----------------
  13. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`Rect3<class_rect3>` | :ref:`Rect3<class_Rect3_Rect3>` **(** :ref:`Vector3<class_vector3>` position, :ref:`Vector3<class_vector3>` size **)** |
  15. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`encloses<class_Rect3_encloses>` **(** :ref:`Rect3<class_rect3>` with **)** |
  17. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`Rect3<class_rect3>` | :ref:`expand<class_Rect3_expand>` **(** :ref:`Vector3<class_vector3>` to_point **)** |
  19. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_area<class_Rect3_get_area>` **(** **)** |
  21. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`Vector3<class_vector3>` | :ref:`get_endpoint<class_Rect3_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |
  23. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Vector3<class_vector3>` | :ref:`get_longest_axis<class_Rect3_get_longest_axis>` **(** **)** |
  25. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_Rect3_get_longest_axis_index>` **(** **)** |
  27. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_Rect3_get_longest_axis_size>` **(** **)** |
  29. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Vector3<class_vector3>` | :ref:`get_shortest_axis<class_Rect3_get_shortest_axis>` **(** **)** |
  31. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_Rect3_get_shortest_axis_index>` **(** **)** |
  33. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_Rect3_get_shortest_axis_size>` **(** **)** |
  35. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`Vector3<class_vector3>` | :ref:`get_support<class_Rect3_get_support>` **(** :ref:`Vector3<class_vector3>` dir **)** |
  37. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Rect3<class_rect3>` | :ref:`grow<class_Rect3_grow>` **(** :ref:`float<class_float>` by **)** |
  39. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`has_no_area<class_Rect3_has_no_area>` **(** **)** |
  41. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`has_no_surface<class_Rect3_has_no_surface>` **(** **)** |
  43. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`has_point<class_Rect3_has_point>` **(** :ref:`Vector3<class_vector3>` point **)** |
  45. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Rect3<class_rect3>` | :ref:`intersection<class_Rect3_intersection>` **(** :ref:`Rect3<class_rect3>` with **)** |
  47. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`intersects<class_Rect3_intersects>` **(** :ref:`Rect3<class_rect3>` with **)** |
  49. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`intersects_plane<class_Rect3_intersects_plane>` **(** :ref:`Plane<class_plane>` plane **)** |
  51. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`intersects_segment<class_Rect3_intersects_segment>` **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to **)** |
  53. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Rect3<class_rect3>` | :ref:`merge<class_Rect3_merge>` **(** :ref:`Rect3<class_rect3>` with **)** |
  55. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
  56. Member Variables
  57. ----------------
  58. - :ref:`Vector3<class_vector3>` **end** - Ending corner.
  59. - :ref:`Vector3<class_vector3>` **position**
  60. - :ref:`Vector3<class_vector3>` **size** - Size from position to end.
  61. Description
  62. -----------
  63. Rect3 provides an 3D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for simple (fast) overlap tests.
  64. Member Function Description
  65. ---------------------------
  66. .. _class_Rect3_Rect3:
  67. - :ref:`Rect3<class_rect3>` **Rect3** **(** :ref:`Vector3<class_vector3>` position, :ref:`Vector3<class_vector3>` size **)**
  68. Optional constructor, accepts position and size.
  69. .. _class_Rect3_encloses:
  70. - :ref:`bool<class_bool>` **encloses** **(** :ref:`Rect3<class_rect3>` with **)**
  71. Return true if this :ref:`Rect3<class_rect3>` completely encloses another one.
  72. .. _class_Rect3_expand:
  73. - :ref:`Rect3<class_rect3>` **expand** **(** :ref:`Vector3<class_vector3>` to_point **)**
  74. Return this :ref:`Rect3<class_rect3>` expanded to include a given point.
  75. .. _class_Rect3_get_area:
  76. - :ref:`float<class_float>` **get_area** **(** **)**
  77. Get the area of the :ref:`Rect3<class_rect3>`.
  78. .. _class_Rect3_get_endpoint:
  79. - :ref:`Vector3<class_vector3>` **get_endpoint** **(** :ref:`int<class_int>` idx **)**
  80. Get the position of the 8 endpoints of the :ref:`Rect3<class_rect3>` in space.
  81. .. _class_Rect3_get_longest_axis:
  82. - :ref:`Vector3<class_vector3>` **get_longest_axis** **(** **)**
  83. Return the normalized longest axis of the :ref:`Rect3<class_rect3>`.
  84. .. _class_Rect3_get_longest_axis_index:
  85. - :ref:`int<class_int>` **get_longest_axis_index** **(** **)**
  86. Return the index of the longest axis of the :ref:`Rect3<class_rect3>` (according to :ref:`Vector3<class_vector3>`::AXIS\* enum).
  87. .. _class_Rect3_get_longest_axis_size:
  88. - :ref:`float<class_float>` **get_longest_axis_size** **(** **)**
  89. Return the scalar length of the longest axis of the :ref:`Rect3<class_rect3>`.
  90. .. _class_Rect3_get_shortest_axis:
  91. - :ref:`Vector3<class_vector3>` **get_shortest_axis** **(** **)**
  92. Return the normalized shortest axis of the :ref:`Rect3<class_rect3>`.
  93. .. _class_Rect3_get_shortest_axis_index:
  94. - :ref:`int<class_int>` **get_shortest_axis_index** **(** **)**
  95. Return the index of the shortest axis of the :ref:`Rect3<class_rect3>` (according to :ref:`Vector3<class_vector3>`::AXIS\* enum).
  96. .. _class_Rect3_get_shortest_axis_size:
  97. - :ref:`float<class_float>` **get_shortest_axis_size** **(** **)**
  98. Return the scalar length of the shortest axis of the :ref:`Rect3<class_rect3>`.
  99. .. _class_Rect3_get_support:
  100. - :ref:`Vector3<class_vector3>` **get_support** **(** :ref:`Vector3<class_vector3>` dir **)**
  101. Return the support point in a given direction. This is useful for collision detection algorithms.
  102. .. _class_Rect3_grow:
  103. - :ref:`Rect3<class_rect3>` **grow** **(** :ref:`float<class_float>` by **)**
  104. Return a copy of the :ref:`Rect3<class_rect3>` grown a given amount of units towards all the sides.
  105. .. _class_Rect3_has_no_area:
  106. - :ref:`bool<class_bool>` **has_no_area** **(** **)**
  107. Return true if the :ref:`Rect3<class_rect3>` is flat or empty.
  108. .. _class_Rect3_has_no_surface:
  109. - :ref:`bool<class_bool>` **has_no_surface** **(** **)**
  110. Return true if the :ref:`Rect3<class_rect3>` is empty.
  111. .. _class_Rect3_has_point:
  112. - :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_vector3>` point **)**
  113. Return true if the :ref:`Rect3<class_rect3>` contains a point.
  114. .. _class_Rect3_intersection:
  115. - :ref:`Rect3<class_rect3>` **intersection** **(** :ref:`Rect3<class_rect3>` with **)**
  116. Return the intersection between two :ref:`Rect3<class_rect3>`. An empty Rect3 (size 0,0,0) is returned on failure.
  117. .. _class_Rect3_intersects:
  118. - :ref:`bool<class_bool>` **intersects** **(** :ref:`Rect3<class_rect3>` with **)**
  119. Return true if the :ref:`Rect3<class_rect3>` overlaps with another.
  120. .. _class_Rect3_intersects_plane:
  121. - :ref:`bool<class_bool>` **intersects_plane** **(** :ref:`Plane<class_plane>` plane **)**
  122. Return true if the :ref:`Rect3<class_rect3>` is at both sides of a plane.
  123. .. _class_Rect3_intersects_segment:
  124. - :ref:`bool<class_bool>` **intersects_segment** **(** :ref:`Vector3<class_vector3>` from, :ref:`Vector3<class_vector3>` to **)**
  125. Return true if the :ref:`Rect3<class_rect3>` intersects the line segment between from and to
  126. .. _class_Rect3_merge:
  127. - :ref:`Rect3<class_rect3>` **merge** **(** :ref:`Rect3<class_rect3>` with **)**
  128. Combine this :ref:`Rect3<class_rect3>` with another, a larger one is returned that contains both.