class_particles.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Particles.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Particles:
  5. Particles
  6. =========
  7. **Inherits:** :ref:`GeometryInstance<class_geometryinstance>` **<** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. 3D particle emitter.
  12. Member Functions
  13. ----------------
  14. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Rect3<class_rect3>` | :ref:`capture_aabb<class_Particles_capture_aabb>` **(** **)** const |
  16. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_amount<class_Particles_get_amount>` **(** **)** const |
  18. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_draw_order<class_Particles_get_draw_order>` **(** **)** const |
  20. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Mesh<class_mesh>` | :ref:`get_draw_pass_mesh<class_Particles_get_draw_pass_mesh>` **(** :ref:`int<class_int>` pass **)** const |
  22. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_draw_passes<class_Particles_get_draw_passes>` **(** **)** const |
  24. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`get_explosiveness_ratio<class_Particles_get_explosiveness_ratio>` **(** **)** const |
  26. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_fixed_fps<class_Particles_get_fixed_fps>` **(** **)** const |
  28. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`get_fractional_delta<class_Particles_get_fractional_delta>` **(** **)** const |
  30. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`get_lifetime<class_Particles_get_lifetime>` **(** **)** const |
  32. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`get_one_shot<class_Particles_get_one_shot>` **(** **)** const |
  34. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`get_pre_process_time<class_Particles_get_pre_process_time>` **(** **)** const |
  36. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Material<class_material>` | :ref:`get_process_material<class_Particles_get_process_material>` **(** **)** const |
  38. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`get_randomness_ratio<class_Particles_get_randomness_ratio>` **(** **)** const |
  40. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`get_speed_scale<class_Particles_get_speed_scale>` **(** **)** const |
  42. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`get_use_local_coordinates<class_Particles_get_use_local_coordinates>` **(** **)** const |
  44. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Rect3<class_rect3>` | :ref:`get_visibility_aabb<class_Particles_get_visibility_aabb>` **(** **)** const |
  46. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`is_emitting<class_Particles_is_emitting>` **(** **)** const |
  48. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`restart<class_Particles_restart>` **(** **)** |
  50. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_amount<class_Particles_set_amount>` **(** :ref:`int<class_int>` amount **)** |
  52. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_draw_order<class_Particles_set_draw_order>` **(** :ref:`int<class_int>` order **)** |
  54. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`set_draw_pass_mesh<class_Particles_set_draw_pass_mesh>` **(** :ref:`int<class_int>` pass, :ref:`Mesh<class_mesh>` mesh **)** |
  56. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`set_draw_passes<class_Particles_set_draw_passes>` **(** :ref:`int<class_int>` passes **)** |
  58. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`set_emitting<class_Particles_set_emitting>` **(** :ref:`bool<class_bool>` emitting **)** |
  60. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`set_explosiveness_ratio<class_Particles_set_explosiveness_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  62. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`set_fixed_fps<class_Particles_set_fixed_fps>` **(** :ref:`int<class_int>` fps **)** |
  64. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`set_fractional_delta<class_Particles_set_fractional_delta>` **(** :ref:`bool<class_bool>` enable **)** |
  66. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`set_lifetime<class_Particles_set_lifetime>` **(** :ref:`float<class_float>` secs **)** |
  68. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_one_shot<class_Particles_set_one_shot>` **(** :ref:`bool<class_bool>` enable **)** |
  70. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_pre_process_time<class_Particles_set_pre_process_time>` **(** :ref:`float<class_float>` secs **)** |
  72. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_process_material<class_Particles_set_process_material>` **(** :ref:`Material<class_material>` material **)** |
  74. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_randomness_ratio<class_Particles_set_randomness_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  76. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_speed_scale<class_Particles_set_speed_scale>` **(** :ref:`float<class_float>` scale **)** |
  78. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_use_local_coordinates<class_Particles_set_use_local_coordinates>` **(** :ref:`bool<class_bool>` enable **)** |
  80. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_visibility_aabb<class_Particles_set_visibility_aabb>` **(** :ref:`Rect3<class_rect3>` aabb **)** |
  82. +----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  83. Member Variables
  84. ----------------
  85. - :ref:`int<class_int>` **amount** - Number of particles to emit.
  86. - :ref:`int<class_int>` **draw_order** - Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [code]DRAW_ORDER_INDEX[/code].
  87. - :ref:`Mesh<class_mesh>` **draw_pass_1**
  88. - :ref:`Mesh<class_mesh>` **draw_pass_2**
  89. - :ref:`Mesh<class_mesh>` **draw_pass_3**
  90. - :ref:`Mesh<class_mesh>` **draw_pass_4**
  91. - :ref:`int<class_int>` **draw_passes**
  92. - :ref:`bool<class_bool>` **emitting** - If [code]true[/code] particles are being emitted. Default value: [code]true[/code].
  93. - :ref:`float<class_float>` **explosiveness** - Time ratio between each emission. If [code]0[/code] particles are emitted continuously. If [code]1[/code] all particles are emitted simultaneously. Default value: [code]0[/code].
  94. - :ref:`int<class_int>` **fixed_fps**
  95. - :ref:`bool<class_bool>` **fract_delta**
  96. - :ref:`float<class_float>` **lifetime** - Amount of time each particle will exist. Default value: [code]1[/code].
  97. - :ref:`bool<class_bool>` **local_coords** - If [code]true[/code] particles use the parent node's coordinate space. If [code]false[/code] they use global coordinates. Default value: [code]true[/code].
  98. - :ref:`bool<class_bool>` **one_shot** - If [code]true[/code] only [code]amount[/code] particles will be emitted. Default value: [code]false[/code].
  99. - :ref:`float<class_float>` **preprocess**
  100. - :ref:`Material<class_material>` **process_material** - [Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial].
  101. - :ref:`float<class_float>` **randomness** - Emission randomness ratio. Default value: [code]0[/code].
  102. - :ref:`float<class_float>` **speed_scale** - Speed scaling ratio. Default value: [code]1[/code].
  103. - :ref:`Rect3<class_rect3>` **visibility_aabb**
  104. Numeric Constants
  105. -----------------
  106. - **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted.
  107. - **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime.
  108. - **DRAW_ORDER_VIEW_DEPTH** = **2** --- Particles are drawn in order of depth.
  109. - **MAX_DRAW_PASSES** = **4**
  110. Description
  111. -----------
  112. 3D particle node used to create a variety of particle systems and effects. ``Particles`` features an emitter that generates some number of particles at a given rate.
  113. Use the ``process_material`` property to add a :ref:`ParticlesMaterial<class_particlesmaterial>` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial<class_shadermaterial>` which will be applied to all particles.
  114. Member Function Description
  115. ---------------------------
  116. .. _class_Particles_capture_aabb:
  117. - :ref:`Rect3<class_rect3>` **capture_aabb** **(** **)** const
  118. .. _class_Particles_get_amount:
  119. - :ref:`int<class_int>` **get_amount** **(** **)** const
  120. .. _class_Particles_get_draw_order:
  121. - :ref:`int<class_int>` **get_draw_order** **(** **)** const
  122. .. _class_Particles_get_draw_pass_mesh:
  123. - :ref:`Mesh<class_mesh>` **get_draw_pass_mesh** **(** :ref:`int<class_int>` pass **)** const
  124. .. _class_Particles_get_draw_passes:
  125. - :ref:`int<class_int>` **get_draw_passes** **(** **)** const
  126. .. _class_Particles_get_explosiveness_ratio:
  127. - :ref:`float<class_float>` **get_explosiveness_ratio** **(** **)** const
  128. .. _class_Particles_get_fixed_fps:
  129. - :ref:`int<class_int>` **get_fixed_fps** **(** **)** const
  130. .. _class_Particles_get_fractional_delta:
  131. - :ref:`bool<class_bool>` **get_fractional_delta** **(** **)** const
  132. .. _class_Particles_get_lifetime:
  133. - :ref:`float<class_float>` **get_lifetime** **(** **)** const
  134. .. _class_Particles_get_one_shot:
  135. - :ref:`bool<class_bool>` **get_one_shot** **(** **)** const
  136. .. _class_Particles_get_pre_process_time:
  137. - :ref:`float<class_float>` **get_pre_process_time** **(** **)** const
  138. .. _class_Particles_get_process_material:
  139. - :ref:`Material<class_material>` **get_process_material** **(** **)** const
  140. .. _class_Particles_get_randomness_ratio:
  141. - :ref:`float<class_float>` **get_randomness_ratio** **(** **)** const
  142. .. _class_Particles_get_speed_scale:
  143. - :ref:`float<class_float>` **get_speed_scale** **(** **)** const
  144. .. _class_Particles_get_use_local_coordinates:
  145. - :ref:`bool<class_bool>` **get_use_local_coordinates** **(** **)** const
  146. .. _class_Particles_get_visibility_aabb:
  147. - :ref:`Rect3<class_rect3>` **get_visibility_aabb** **(** **)** const
  148. .. _class_Particles_is_emitting:
  149. - :ref:`bool<class_bool>` **is_emitting** **(** **)** const
  150. .. _class_Particles_restart:
  151. - void **restart** **(** **)**
  152. .. _class_Particles_set_amount:
  153. - void **set_amount** **(** :ref:`int<class_int>` amount **)**
  154. .. _class_Particles_set_draw_order:
  155. - void **set_draw_order** **(** :ref:`int<class_int>` order **)**
  156. .. _class_Particles_set_draw_pass_mesh:
  157. - void **set_draw_pass_mesh** **(** :ref:`int<class_int>` pass, :ref:`Mesh<class_mesh>` mesh **)**
  158. .. _class_Particles_set_draw_passes:
  159. - void **set_draw_passes** **(** :ref:`int<class_int>` passes **)**
  160. .. _class_Particles_set_emitting:
  161. - void **set_emitting** **(** :ref:`bool<class_bool>` emitting **)**
  162. .. _class_Particles_set_explosiveness_ratio:
  163. - void **set_explosiveness_ratio** **(** :ref:`float<class_float>` ratio **)**
  164. .. _class_Particles_set_fixed_fps:
  165. - void **set_fixed_fps** **(** :ref:`int<class_int>` fps **)**
  166. .. _class_Particles_set_fractional_delta:
  167. - void **set_fractional_delta** **(** :ref:`bool<class_bool>` enable **)**
  168. .. _class_Particles_set_lifetime:
  169. - void **set_lifetime** **(** :ref:`float<class_float>` secs **)**
  170. .. _class_Particles_set_one_shot:
  171. - void **set_one_shot** **(** :ref:`bool<class_bool>` enable **)**
  172. .. _class_Particles_set_pre_process_time:
  173. - void **set_pre_process_time** **(** :ref:`float<class_float>` secs **)**
  174. .. _class_Particles_set_process_material:
  175. - void **set_process_material** **(** :ref:`Material<class_material>` material **)**
  176. .. _class_Particles_set_randomness_ratio:
  177. - void **set_randomness_ratio** **(** :ref:`float<class_float>` ratio **)**
  178. .. _class_Particles_set_speed_scale:
  179. - void **set_speed_scale** **(** :ref:`float<class_float>` scale **)**
  180. .. _class_Particles_set_use_local_coordinates:
  181. - void **set_use_local_coordinates** **(** :ref:`bool<class_bool>` enable **)**
  182. .. _class_Particles_set_visibility_aabb:
  183. - void **set_visibility_aabb** **(** :ref:`Rect3<class_rect3>` aabb **)**