class_area3d.rst 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. :github_url: hide
  2. .. meta::
  3. :keywords: trigger
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Area3D.xml.
  8. .. _class_Area3D:
  9. Area3D
  10. ======
  11. **Inherits:** :ref:`CollisionObject3D<class_CollisionObject3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. A region of 3D space that detects other :ref:`CollisionObject3D<class_CollisionObject3D>`\ s entering or exiting it.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. **Area3D** is a region of 3D space defined by one or multiple :ref:`CollisionShape3D<class_CollisionShape3D>` or :ref:`CollisionPolygon3D<class_CollisionPolygon3D>` child nodes. It detects when other :ref:`CollisionObject3D<class_CollisionObject3D>`\ s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it).
  17. This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses.
  18. \ **Note:** Areas and bodies created with :ref:`PhysicsServer3D<class_PhysicsServer3D>` might not interact as expected with **Area3D**\ s, and might not emit signals or track objects correctly.
  19. \ **Warning:** Using a :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>` inside a :ref:`CollisionShape3D<class_CollisionShape3D>` child of this node (created e.g. by using the **Create Trimesh Collision Sibling** option in the **Mesh** menu that appears when selecting a :ref:`MeshInstance3D<class_MeshInstance3D>` node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>`\ s or primitive shapes like :ref:`BoxShape3D<class_BoxShape3D>`, or in some cases it may be replaceable by a :ref:`CollisionPolygon3D<class_CollisionPolygon3D>`.
  20. .. rst-class:: classref-introduction-group
  21. Tutorials
  22. ---------
  23. - :doc:`Using Area2D <../tutorials/physics/using_area_2d>`
  24. - `3D Platformer Demo <https://godotengine.org/asset-library/asset/2748>`__
  25. - `GUI in 3D Viewport Demo <https://godotengine.org/asset-library/asset/2807>`__
  26. .. rst-class:: classref-reftable-group
  27. Properties
  28. ----------
  29. .. table::
  30. :widths: auto
  31. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  32. | :ref:`float<class_float>` | :ref:`angular_damp<class_Area3D_property_angular_damp>` | ``0.1`` |
  33. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  34. | :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` | :ref:`angular_damp_space_override<class_Area3D_property_angular_damp_space_override>` | ``0`` |
  35. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  36. | :ref:`StringName<class_StringName>` | :ref:`audio_bus_name<class_Area3D_property_audio_bus_name>` | ``&"Master"`` |
  37. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  38. | :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area3D_property_audio_bus_override>` | ``false`` |
  39. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  40. | :ref:`float<class_float>` | :ref:`gravity<class_Area3D_property_gravity>` | ``9.8`` |
  41. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  42. | :ref:`Vector3<class_Vector3>` | :ref:`gravity_direction<class_Area3D_property_gravity_direction>` | ``Vector3(0, -1, 0)`` |
  43. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  44. | :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area3D_property_gravity_point>` | ``false`` |
  45. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  46. | :ref:`Vector3<class_Vector3>` | :ref:`gravity_point_center<class_Area3D_property_gravity_point_center>` | ``Vector3(0, -1, 0)`` |
  47. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  48. | :ref:`float<class_float>` | :ref:`gravity_point_unit_distance<class_Area3D_property_gravity_point_unit_distance>` | ``0.0`` |
  49. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  50. | :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` | :ref:`gravity_space_override<class_Area3D_property_gravity_space_override>` | ``0`` |
  51. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  52. | :ref:`float<class_float>` | :ref:`linear_damp<class_Area3D_property_linear_damp>` | ``0.1`` |
  53. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  54. | :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` | :ref:`linear_damp_space_override<class_Area3D_property_linear_damp_space_override>` | ``0`` |
  55. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  56. | :ref:`bool<class_bool>` | :ref:`monitorable<class_Area3D_property_monitorable>` | ``true`` |
  57. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  58. | :ref:`bool<class_bool>` | :ref:`monitoring<class_Area3D_property_monitoring>` | ``true`` |
  59. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  60. | :ref:`int<class_int>` | :ref:`priority<class_Area3D_property_priority>` | ``0`` |
  61. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  62. | :ref:`float<class_float>` | :ref:`reverb_bus_amount<class_Area3D_property_reverb_bus_amount>` | ``0.0`` |
  63. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  64. | :ref:`bool<class_bool>` | :ref:`reverb_bus_enabled<class_Area3D_property_reverb_bus_enabled>` | ``false`` |
  65. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  66. | :ref:`StringName<class_StringName>` | :ref:`reverb_bus_name<class_Area3D_property_reverb_bus_name>` | ``&"Master"`` |
  67. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  68. | :ref:`float<class_float>` | :ref:`reverb_bus_uniformity<class_Area3D_property_reverb_bus_uniformity>` | ``0.0`` |
  69. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  70. | :ref:`float<class_float>` | :ref:`wind_attenuation_factor<class_Area3D_property_wind_attenuation_factor>` | ``0.0`` |
  71. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  72. | :ref:`float<class_float>` | :ref:`wind_force_magnitude<class_Area3D_property_wind_force_magnitude>` | ``0.0`` |
  73. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  74. | :ref:`NodePath<class_NodePath>` | :ref:`wind_source_path<class_Area3D_property_wind_source_path>` | ``NodePath("")`` |
  75. +-------------------------------------------------+---------------------------------------------------------------------------------------+-----------------------+
  76. .. rst-class:: classref-reftable-group
  77. Methods
  78. -------
  79. .. table::
  80. :widths: auto
  81. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  82. | :ref:`Array<class_Array>`\[:ref:`Area3D<class_Area3D>`\] | :ref:`get_overlapping_areas<class_Area3D_method_get_overlapping_areas>`\ (\ ) |const| |
  83. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  84. | :ref:`Array<class_Array>`\[:ref:`Node3D<class_Node3D>`\] | :ref:`get_overlapping_bodies<class_Area3D_method_get_overlapping_bodies>`\ (\ ) |const| |
  85. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`has_overlapping_areas<class_Area3D_method_has_overlapping_areas>`\ (\ ) |const| |
  87. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`has_overlapping_bodies<class_Area3D_method_has_overlapping_bodies>`\ (\ ) |const| |
  89. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area3D_method_overlaps_area>`\ (\ area\: :ref:`Node<class_Node>`\ ) |const| |
  91. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  92. | :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area3D_method_overlaps_body>`\ (\ body\: :ref:`Node<class_Node>`\ ) |const| |
  93. +----------------------------------------------------------+-------------------------------------------------------------------------------------------------------+
  94. .. rst-class:: classref-section-separator
  95. ----
  96. .. rst-class:: classref-descriptions-group
  97. Signals
  98. -------
  99. .. _class_Area3D_signal_area_entered:
  100. .. rst-class:: classref-signal
  101. **area_entered**\ (\ area\: :ref:`Area3D<class_Area3D>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_area_entered>`
  102. Emitted when the received ``area`` enters this area. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_Area3D_signal_area_exited:
  106. .. rst-class:: classref-signal
  107. **area_exited**\ (\ area\: :ref:`Area3D<class_Area3D>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_area_exited>`
  108. Emitted when the received ``area`` exits this area. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_Area3D_signal_area_shape_entered:
  112. .. rst-class:: classref-signal
  113. **area_shape_entered**\ (\ area_rid\: :ref:`RID<class_RID>`, area\: :ref:`Area3D<class_Area3D>`, area_shape_index\: :ref:`int<class_int>`, local_shape_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_area_shape_entered>`
  114. Emitted when a :ref:`Shape3D<class_Shape3D>` of the received ``area`` enters a shape of this area. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  115. \ ``local_shape_index`` and ``area_shape_index`` contain indices of the interacting shapes from this area and the other area, respectively. ``area_rid`` contains the :ref:`RID<class_RID>` of the other area. These values can be used with the :ref:`PhysicsServer3D<class_PhysicsServer3D>`.
  116. \ **Example:** Get the :ref:`CollisionShape3D<class_CollisionShape3D>` node from the shape index:
  117. .. tabs::
  118. .. code-tab:: gdscript
  119. var other_shape_owner = area.shape_find_owner(area_shape_index)
  120. var other_shape_node = area.shape_owner_get_owner(other_shape_owner)
  121. var local_shape_owner = shape_find_owner(local_shape_index)
  122. var local_shape_node = shape_owner_get_owner(local_shape_owner)
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_Area3D_signal_area_shape_exited:
  126. .. rst-class:: classref-signal
  127. **area_shape_exited**\ (\ area_rid\: :ref:`RID<class_RID>`, area\: :ref:`Area3D<class_Area3D>`, area_shape_index\: :ref:`int<class_int>`, local_shape_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_area_shape_exited>`
  128. Emitted when a :ref:`Shape3D<class_Shape3D>` of the received ``area`` exits a shape of this area. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  129. See also :ref:`area_shape_entered<class_Area3D_signal_area_shape_entered>`.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_Area3D_signal_body_entered:
  133. .. rst-class:: classref-signal
  134. **body_entered**\ (\ body\: :ref:`Node3D<class_Node3D>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_body_entered>`
  135. Emitted when the received ``body`` enters this area. ``body`` can be a :ref:`PhysicsBody3D<class_PhysicsBody3D>` or a :ref:`GridMap<class_GridMap>`. :ref:`GridMap<class_GridMap>`\ s are detected if their :ref:`MeshLibrary<class_MeshLibrary>` has collision shapes configured. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_Area3D_signal_body_exited:
  139. .. rst-class:: classref-signal
  140. **body_exited**\ (\ body\: :ref:`Node3D<class_Node3D>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_body_exited>`
  141. Emitted when the received ``body`` exits this area. ``body`` can be a :ref:`PhysicsBody3D<class_PhysicsBody3D>` or a :ref:`GridMap<class_GridMap>`. :ref:`GridMap<class_GridMap>`\ s are detected if their :ref:`MeshLibrary<class_MeshLibrary>` has collision shapes configured. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_Area3D_signal_body_shape_entered:
  145. .. rst-class:: classref-signal
  146. **body_shape_entered**\ (\ body_rid\: :ref:`RID<class_RID>`, body\: :ref:`Node3D<class_Node3D>`, body_shape_index\: :ref:`int<class_int>`, local_shape_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_body_shape_entered>`
  147. Emitted when a :ref:`Shape3D<class_Shape3D>` of the received ``body`` enters a shape of this area. ``body`` can be a :ref:`PhysicsBody3D<class_PhysicsBody3D>` or a :ref:`GridMap<class_GridMap>`. :ref:`GridMap<class_GridMap>`\ s are detected if their :ref:`MeshLibrary<class_MeshLibrary>` has collision shapes configured. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  148. \ ``local_shape_index`` and ``body_shape_index`` contain indices of the interacting shapes from this area and the interacting body, respectively. ``body_rid`` contains the :ref:`RID<class_RID>` of the body. These values can be used with the :ref:`PhysicsServer3D<class_PhysicsServer3D>`.
  149. \ **Example:** Get the :ref:`CollisionShape3D<class_CollisionShape3D>` node from the shape index:
  150. .. tabs::
  151. .. code-tab:: gdscript
  152. var body_shape_owner = body.shape_find_owner(body_shape_index)
  153. var body_shape_node = body.shape_owner_get_owner(body_shape_owner)
  154. var local_shape_owner = shape_find_owner(local_shape_index)
  155. var local_shape_node = shape_owner_get_owner(local_shape_owner)
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_Area3D_signal_body_shape_exited:
  159. .. rst-class:: classref-signal
  160. **body_shape_exited**\ (\ body_rid\: :ref:`RID<class_RID>`, body\: :ref:`Node3D<class_Node3D>`, body_shape_index\: :ref:`int<class_int>`, local_shape_index\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_Area3D_signal_body_shape_exited>`
  161. Emitted when a :ref:`Shape3D<class_Shape3D>` of the received ``body`` exits a shape of this area. ``body`` can be a :ref:`PhysicsBody3D<class_PhysicsBody3D>` or a :ref:`GridMap<class_GridMap>`. :ref:`GridMap<class_GridMap>`\ s are detected if their :ref:`MeshLibrary<class_MeshLibrary>` has collision shapes configured. Requires :ref:`monitoring<class_Area3D_property_monitoring>` to be set to ``true``.
  162. See also :ref:`body_shape_entered<class_Area3D_signal_body_shape_entered>`.
  163. .. rst-class:: classref-section-separator
  164. ----
  165. .. rst-class:: classref-descriptions-group
  166. Enumerations
  167. ------------
  168. .. _enum_Area3D_SpaceOverride:
  169. .. rst-class:: classref-enumeration
  170. enum **SpaceOverride**: :ref:`๐Ÿ”—<enum_Area3D_SpaceOverride>`
  171. .. _class_Area3D_constant_SPACE_OVERRIDE_DISABLED:
  172. .. rst-class:: classref-enumeration-constant
  173. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **SPACE_OVERRIDE_DISABLED** = ``0``
  174. This area does not affect gravity/damping.
  175. .. _class_Area3D_constant_SPACE_OVERRIDE_COMBINE:
  176. .. rst-class:: classref-enumeration-constant
  177. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **SPACE_OVERRIDE_COMBINE** = ``1``
  178. This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area3D_property_priority>` order).
  179. .. _class_Area3D_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
  180. .. rst-class:: classref-enumeration-constant
  181. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **SPACE_OVERRIDE_COMBINE_REPLACE** = ``2``
  182. This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area3D_property_priority>` order), ignoring any lower priority areas.
  183. .. _class_Area3D_constant_SPACE_OVERRIDE_REPLACE:
  184. .. rst-class:: classref-enumeration-constant
  185. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **SPACE_OVERRIDE_REPLACE** = ``3``
  186. This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
  187. .. _class_Area3D_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
  188. .. rst-class:: classref-enumeration-constant
  189. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **SPACE_OVERRIDE_REPLACE_COMBINE** = ``4``
  190. This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area3D_property_priority>` order), but keeps calculating the rest of the areas.
  191. .. rst-class:: classref-section-separator
  192. ----
  193. .. rst-class:: classref-descriptions-group
  194. Property Descriptions
  195. ---------------------
  196. .. _class_Area3D_property_angular_damp:
  197. .. rst-class:: classref-property
  198. :ref:`float<class_float>` **angular_damp** = ``0.1`` :ref:`๐Ÿ”—<class_Area3D_property_angular_damp>`
  199. .. rst-class:: classref-property-setget
  200. - |void| **set_angular_damp**\ (\ value\: :ref:`float<class_float>`\ )
  201. - :ref:`float<class_float>` **get_angular_damp**\ (\ )
  202. The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
  203. See :ref:`ProjectSettings.physics/3d/default_angular_damp<class_ProjectSettings_property_physics/3d/default_angular_damp>` for more details about damping.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_Area3D_property_angular_damp_space_override:
  207. .. rst-class:: classref-property
  208. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **angular_damp_space_override** = ``0`` :ref:`๐Ÿ”—<class_Area3D_property_angular_damp_space_override>`
  209. .. rst-class:: classref-property-setget
  210. - |void| **set_angular_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
  211. - :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_angular_damp_space_override_mode**\ (\ )
  212. Override mode for angular damping calculations within this area. See :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` for possible values.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_Area3D_property_audio_bus_name:
  216. .. rst-class:: classref-property
  217. :ref:`StringName<class_StringName>` **audio_bus_name** = ``&"Master"`` :ref:`๐Ÿ”—<class_Area3D_property_audio_bus_name>`
  218. .. rst-class:: classref-property-setget
  219. - |void| **set_audio_bus_name**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  220. - :ref:`StringName<class_StringName>` **get_audio_bus_name**\ (\ )
  221. The name of the area's audio bus.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_Area3D_property_audio_bus_override:
  225. .. rst-class:: classref-property
  226. :ref:`bool<class_bool>` **audio_bus_override** = ``false`` :ref:`๐Ÿ”—<class_Area3D_property_audio_bus_override>`
  227. .. rst-class:: classref-property-setget
  228. - |void| **set_audio_bus_override**\ (\ value\: :ref:`bool<class_bool>`\ )
  229. - :ref:`bool<class_bool>` **is_overriding_audio_bus**\ (\ )
  230. If ``true``, the area's audio bus overrides the default audio bus.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_Area3D_property_gravity:
  234. .. rst-class:: classref-property
  235. :ref:`float<class_float>` **gravity** = ``9.8`` :ref:`๐Ÿ”—<class_Area3D_property_gravity>`
  236. .. rst-class:: classref-property-setget
  237. - |void| **set_gravity**\ (\ value\: :ref:`float<class_float>`\ )
  238. - :ref:`float<class_float>` **get_gravity**\ (\ )
  239. The area's gravity intensity (in meters per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_Area3D_property_gravity_direction:
  243. .. rst-class:: classref-property
  244. :ref:`Vector3<class_Vector3>` **gravity_direction** = ``Vector3(0, -1, 0)`` :ref:`๐Ÿ”—<class_Area3D_property_gravity_direction>`
  245. .. rst-class:: classref-property-setget
  246. - |void| **set_gravity_direction**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  247. - :ref:`Vector3<class_Vector3>` **get_gravity_direction**\ (\ )
  248. The area's gravity vector (not normalized).
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_Area3D_property_gravity_point:
  252. .. rst-class:: classref-property
  253. :ref:`bool<class_bool>` **gravity_point** = ``false`` :ref:`๐Ÿ”—<class_Area3D_property_gravity_point>`
  254. .. rst-class:: classref-property-setget
  255. - |void| **set_gravity_is_point**\ (\ value\: :ref:`bool<class_bool>`\ )
  256. - :ref:`bool<class_bool>` **is_gravity_a_point**\ (\ )
  257. If ``true``, gravity is calculated from a point (set via :ref:`gravity_point_center<class_Area3D_property_gravity_point_center>`). See also :ref:`gravity_space_override<class_Area3D_property_gravity_space_override>`.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_Area3D_property_gravity_point_center:
  261. .. rst-class:: classref-property
  262. :ref:`Vector3<class_Vector3>` **gravity_point_center** = ``Vector3(0, -1, 0)`` :ref:`๐Ÿ”—<class_Area3D_property_gravity_point_center>`
  263. .. rst-class:: classref-property-setget
  264. - |void| **set_gravity_point_center**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  265. - :ref:`Vector3<class_Vector3>` **get_gravity_point_center**\ (\ )
  266. If gravity is a point (see :ref:`gravity_point<class_Area3D_property_gravity_point>`), this will be the point of attraction.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_Area3D_property_gravity_point_unit_distance:
  270. .. rst-class:: classref-property
  271. :ref:`float<class_float>` **gravity_point_unit_distance** = ``0.0`` :ref:`๐Ÿ”—<class_Area3D_property_gravity_point_unit_distance>`
  272. .. rst-class:: classref-property-setget
  273. - |void| **set_gravity_point_unit_distance**\ (\ value\: :ref:`float<class_float>`\ )
  274. - :ref:`float<class_float>` **get_gravity_point_unit_distance**\ (\ )
  275. The distance at which the gravity strength is equal to :ref:`gravity<class_Area3D_property_gravity>`. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/sยฒ, set the :ref:`gravity<class_Area3D_property_gravity>` to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/sยฒ (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/sยฒ (half the distance, 4x the gravity), and so on.
  276. The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_Area3D_property_gravity_space_override:
  280. .. rst-class:: classref-property
  281. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **gravity_space_override** = ``0`` :ref:`๐Ÿ”—<class_Area3D_property_gravity_space_override>`
  282. .. rst-class:: classref-property-setget
  283. - |void| **set_gravity_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
  284. - :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_gravity_space_override_mode**\ (\ )
  285. Override mode for gravity calculations within this area. See :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` for possible values.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_Area3D_property_linear_damp:
  289. .. rst-class:: classref-property
  290. :ref:`float<class_float>` **linear_damp** = ``0.1`` :ref:`๐Ÿ”—<class_Area3D_property_linear_damp>`
  291. .. rst-class:: classref-property-setget
  292. - |void| **set_linear_damp**\ (\ value\: :ref:`float<class_float>`\ )
  293. - :ref:`float<class_float>` **get_linear_damp**\ (\ )
  294. The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
  295. See :ref:`ProjectSettings.physics/3d/default_linear_damp<class_ProjectSettings_property_physics/3d/default_linear_damp>` for more details about damping.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_Area3D_property_linear_damp_space_override:
  299. .. rst-class:: classref-property
  300. :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **linear_damp_space_override** = ``0`` :ref:`๐Ÿ”—<class_Area3D_property_linear_damp_space_override>`
  301. .. rst-class:: classref-property-setget
  302. - |void| **set_linear_damp_space_override_mode**\ (\ value\: :ref:`SpaceOverride<enum_Area3D_SpaceOverride>`\ )
  303. - :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` **get_linear_damp_space_override_mode**\ (\ )
  304. Override mode for linear damping calculations within this area. See :ref:`SpaceOverride<enum_Area3D_SpaceOverride>` for possible values.
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_Area3D_property_monitorable:
  308. .. rst-class:: classref-property
  309. :ref:`bool<class_bool>` **monitorable** = ``true`` :ref:`๐Ÿ”—<class_Area3D_property_monitorable>`
  310. .. rst-class:: classref-property-setget
  311. - |void| **set_monitorable**\ (\ value\: :ref:`bool<class_bool>`\ )
  312. - :ref:`bool<class_bool>` **is_monitorable**\ (\ )
  313. If ``true``, other monitoring areas can detect this area.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_Area3D_property_monitoring:
  317. .. rst-class:: classref-property
  318. :ref:`bool<class_bool>` **monitoring** = ``true`` :ref:`๐Ÿ”—<class_Area3D_property_monitoring>`
  319. .. rst-class:: classref-property-setget
  320. - |void| **set_monitoring**\ (\ value\: :ref:`bool<class_bool>`\ )
  321. - :ref:`bool<class_bool>` **is_monitoring**\ (\ )
  322. If ``true``, the area detects bodies or areas entering and exiting it.
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _class_Area3D_property_priority:
  326. .. rst-class:: classref-property
  327. :ref:`int<class_int>` **priority** = ``0`` :ref:`๐Ÿ”—<class_Area3D_property_priority>`
  328. .. rst-class:: classref-property-setget
  329. - |void| **set_priority**\ (\ value\: :ref:`int<class_int>`\ )
  330. - :ref:`int<class_int>` **get_priority**\ (\ )
  331. The area's priority. Higher priority areas are processed first. The :ref:`World3D<class_World3D>`'s physics is always processed last, after all areas.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_Area3D_property_reverb_bus_amount:
  335. .. rst-class:: classref-property
  336. :ref:`float<class_float>` **reverb_bus_amount** = ``0.0`` :ref:`๐Ÿ”—<class_Area3D_property_reverb_bus_amount>`
  337. .. rst-class:: classref-property-setget
  338. - |void| **set_reverb_amount**\ (\ value\: :ref:`float<class_float>`\ )
  339. - :ref:`float<class_float>` **get_reverb_amount**\ (\ )
  340. The degree to which this area applies reverb to its associated audio. Ranges from ``0`` to ``1`` with ``0.1`` precision.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_Area3D_property_reverb_bus_enabled:
  344. .. rst-class:: classref-property
  345. :ref:`bool<class_bool>` **reverb_bus_enabled** = ``false`` :ref:`๐Ÿ”—<class_Area3D_property_reverb_bus_enabled>`
  346. .. rst-class:: classref-property-setget
  347. - |void| **set_use_reverb_bus**\ (\ value\: :ref:`bool<class_bool>`\ )
  348. - :ref:`bool<class_bool>` **is_using_reverb_bus**\ (\ )
  349. If ``true``, the area applies reverb to its associated audio.
  350. .. rst-class:: classref-item-separator
  351. ----
  352. .. _class_Area3D_property_reverb_bus_name:
  353. .. rst-class:: classref-property
  354. :ref:`StringName<class_StringName>` **reverb_bus_name** = ``&"Master"`` :ref:`๐Ÿ”—<class_Area3D_property_reverb_bus_name>`
  355. .. rst-class:: classref-property-setget
  356. - |void| **set_reverb_bus_name**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  357. - :ref:`StringName<class_StringName>` **get_reverb_bus_name**\ (\ )
  358. The name of the reverb bus to use for this area's associated audio.
  359. .. rst-class:: classref-item-separator
  360. ----
  361. .. _class_Area3D_property_reverb_bus_uniformity:
  362. .. rst-class:: classref-property
  363. :ref:`float<class_float>` **reverb_bus_uniformity** = ``0.0`` :ref:`๐Ÿ”—<class_Area3D_property_reverb_bus_uniformity>`
  364. .. rst-class:: classref-property-setget
  365. - |void| **set_reverb_uniformity**\ (\ value\: :ref:`float<class_float>`\ )
  366. - :ref:`float<class_float>` **get_reverb_uniformity**\ (\ )
  367. The degree to which this area's reverb is a uniform effect. Ranges from ``0`` to ``1`` with ``0.1`` precision.
  368. .. rst-class:: classref-item-separator
  369. ----
  370. .. _class_Area3D_property_wind_attenuation_factor:
  371. .. rst-class:: classref-property
  372. :ref:`float<class_float>` **wind_attenuation_factor** = ``0.0`` :ref:`๐Ÿ”—<class_Area3D_property_wind_attenuation_factor>`
  373. .. rst-class:: classref-property-setget
  374. - |void| **set_wind_attenuation_factor**\ (\ value\: :ref:`float<class_float>`\ )
  375. - :ref:`float<class_float>` **get_wind_attenuation_factor**\ (\ )
  376. The exponential rate at which wind force decreases with distance from its origin.
  377. \ **Note:** This wind force only applies to :ref:`SoftBody3D<class_SoftBody3D>` nodes. Other physics bodies are currently not affected by wind.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_Area3D_property_wind_force_magnitude:
  381. .. rst-class:: classref-property
  382. :ref:`float<class_float>` **wind_force_magnitude** = ``0.0`` :ref:`๐Ÿ”—<class_Area3D_property_wind_force_magnitude>`
  383. .. rst-class:: classref-property-setget
  384. - |void| **set_wind_force_magnitude**\ (\ value\: :ref:`float<class_float>`\ )
  385. - :ref:`float<class_float>` **get_wind_force_magnitude**\ (\ )
  386. The magnitude of area-specific wind force.
  387. \ **Note:** This wind force only applies to :ref:`SoftBody3D<class_SoftBody3D>` nodes. Other physics bodies are currently not affected by wind.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_Area3D_property_wind_source_path:
  391. .. rst-class:: classref-property
  392. :ref:`NodePath<class_NodePath>` **wind_source_path** = ``NodePath("")`` :ref:`๐Ÿ”—<class_Area3D_property_wind_source_path>`
  393. .. rst-class:: classref-property-setget
  394. - |void| **set_wind_source_path**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  395. - :ref:`NodePath<class_NodePath>` **get_wind_source_path**\ (\ )
  396. The :ref:`Node3D<class_Node3D>` which is used to specify the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the :ref:`Node3D<class_Node3D>`'s local transform, and its origin is the origin of the :ref:`Node3D<class_Node3D>`'s local transform.
  397. \ **Note:** This wind force only applies to :ref:`SoftBody3D<class_SoftBody3D>` nodes. Other physics bodies are currently not affected by wind.
  398. .. rst-class:: classref-section-separator
  399. ----
  400. .. rst-class:: classref-descriptions-group
  401. Method Descriptions
  402. -------------------
  403. .. _class_Area3D_method_get_overlapping_areas:
  404. .. rst-class:: classref-method
  405. :ref:`Array<class_Array>`\[:ref:`Area3D<class_Area3D>`\] **get_overlapping_areas**\ (\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_get_overlapping_areas>`
  406. Returns a list of intersecting **Area3D**\ s. The overlapping area's :ref:`CollisionObject3D.collision_layer<class_CollisionObject3D_property_collision_layer>` must be part of this area's :ref:`CollisionObject3D.collision_mask<class_CollisionObject3D_property_collision_mask>` in order to be detected.
  407. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_Area3D_method_get_overlapping_bodies:
  411. .. rst-class:: classref-method
  412. :ref:`Array<class_Array>`\[:ref:`Node3D<class_Node3D>`\] **get_overlapping_bodies**\ (\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_get_overlapping_bodies>`
  413. Returns a list of intersecting :ref:`PhysicsBody3D<class_PhysicsBody3D>`\ s and :ref:`GridMap<class_GridMap>`\ s. The overlapping body's :ref:`CollisionObject3D.collision_layer<class_CollisionObject3D_property_collision_layer>` must be part of this area's :ref:`CollisionObject3D.collision_mask<class_CollisionObject3D_property_collision_mask>` in order to be detected.
  414. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_Area3D_method_has_overlapping_areas:
  418. .. rst-class:: classref-method
  419. :ref:`bool<class_bool>` **has_overlapping_areas**\ (\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_has_overlapping_areas>`
  420. Returns ``true`` if intersecting any **Area3D**\ s, otherwise returns ``false``. The overlapping area's :ref:`CollisionObject3D.collision_layer<class_CollisionObject3D_property_collision_layer>` must be part of this area's :ref:`CollisionObject3D.collision_mask<class_CollisionObject3D_property_collision_mask>` in order to be detected.
  421. For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_Area3D_method_has_overlapping_bodies:
  425. .. rst-class:: classref-method
  426. :ref:`bool<class_bool>` **has_overlapping_bodies**\ (\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_has_overlapping_bodies>`
  427. Returns ``true`` if intersecting any :ref:`PhysicsBody3D<class_PhysicsBody3D>`\ s or :ref:`GridMap<class_GridMap>`\ s, otherwise returns ``false``. The overlapping body's :ref:`CollisionObject3D.collision_layer<class_CollisionObject3D_property_collision_layer>` must be part of this area's :ref:`CollisionObject3D.collision_mask<class_CollisionObject3D_property_collision_mask>` in order to be detected.
  428. For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_Area3D_method_overlaps_area:
  432. .. rst-class:: classref-method
  433. :ref:`bool<class_bool>` **overlaps_area**\ (\ area\: :ref:`Node<class_Node>`\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_overlaps_area>`
  434. Returns ``true`` if the given **Area3D** intersects or overlaps this **Area3D**, ``false`` otherwise.
  435. \ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_Area3D_method_overlaps_body:
  439. .. rst-class:: classref-method
  440. :ref:`bool<class_bool>` **overlaps_body**\ (\ body\: :ref:`Node<class_Node>`\ ) |const| :ref:`๐Ÿ”—<class_Area3D_method_overlaps_body>`
  441. Returns ``true`` if the given physics body intersects or overlaps this **Area3D**, ``false`` otherwise.
  442. \ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
  443. The ``body`` argument can either be a :ref:`PhysicsBody3D<class_PhysicsBody3D>` or a :ref:`GridMap<class_GridMap>` instance. While GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body.
  444. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  445. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  446. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  447. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  448. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  449. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  450. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  451. .. |void| replace:: :abbr:`void (No return value.)`