class_area3d.rst 36 KB

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