class_cpuparticles.rst 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CPUParticles.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CPUParticles:
  6. CPUParticles
  7. ============
  8. **Inherits:** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. CPU-based 3D particle emitter.
  13. Properties
  14. ----------
  15. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`amount<class_CPUParticles_property_amount>` |
  17. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`angle<class_CPUParticles_property_angle>` |
  19. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  20. | :ref:`Curve<class_Curve>` | :ref:`angle_curve<class_CPUParticles_property_angle_curve>` |
  21. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`angle_random<class_CPUParticles_property_angle_random>` |
  23. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`angular_velocity<class_CPUParticles_property_angular_velocity>` |
  25. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  26. | :ref:`Curve<class_Curve>` | :ref:`angular_velocity_curve<class_CPUParticles_property_angular_velocity_curve>` |
  27. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`angular_velocity_random<class_CPUParticles_property_angular_velocity_random>` |
  29. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`anim_offset<class_CPUParticles_property_anim_offset>` |
  31. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  32. | :ref:`Curve<class_Curve>` | :ref:`anim_offset_curve<class_CPUParticles_property_anim_offset_curve>` |
  33. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`anim_offset_random<class_CPUParticles_property_anim_offset_random>` |
  35. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`anim_speed<class_CPUParticles_property_anim_speed>` |
  37. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  38. | :ref:`Curve<class_Curve>` | :ref:`anim_speed_curve<class_CPUParticles_property_anim_speed_curve>` |
  39. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`anim_speed_random<class_CPUParticles_property_anim_speed_random>` |
  41. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  42. | :ref:`Color<class_Color>` | :ref:`color<class_CPUParticles_property_color>` |
  43. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  44. | :ref:`Gradient<class_Gradient>` | :ref:`color_ramp<class_CPUParticles_property_color_ramp>` |
  45. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`damping<class_CPUParticles_property_damping>` |
  47. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  48. | :ref:`Curve<class_Curve>` | :ref:`damping_curve<class_CPUParticles_property_damping_curve>` |
  49. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  50. | :ref:`float<class_float>` | :ref:`damping_random<class_CPUParticles_property_damping_random>` |
  51. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`DrawOrder<enum_CPUParticles_DrawOrder>` | :ref:`draw_order<class_CPUParticles_property_draw_order>` |
  53. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`Vector3<class_Vector3>` | :ref:`emission_box_extents<class_CPUParticles_property_emission_box_extents>` |
  55. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`emission_colors<class_CPUParticles_property_emission_colors>` |
  57. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`emission_normals<class_CPUParticles_property_emission_normals>` |
  59. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`emission_points<class_CPUParticles_property_emission_points>` |
  61. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`EmissionShape<enum_CPUParticles_EmissionShape>` | :ref:`emission_shape<class_CPUParticles_property_emission_shape>` |
  63. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`float<class_float>` | :ref:`emission_sphere_radius<class_CPUParticles_property_emission_sphere_radius>` |
  65. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`emitting<class_CPUParticles_property_emitting>` |
  67. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`explosiveness<class_CPUParticles_property_explosiveness>` |
  69. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`fixed_fps<class_CPUParticles_property_fixed_fps>` |
  71. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`flag_align_y<class_CPUParticles_property_flag_align_y>` |
  73. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`flag_disable_z<class_CPUParticles_property_flag_disable_z>` |
  75. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`bool<class_bool>` | :ref:`flag_rotate_y<class_CPUParticles_property_flag_rotate_y>` |
  77. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`float<class_float>` | :ref:`flatness<class_CPUParticles_property_flatness>` |
  79. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`bool<class_bool>` | :ref:`fract_delta<class_CPUParticles_property_fract_delta>` |
  81. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`Vector3<class_Vector3>` | :ref:`gravity<class_CPUParticles_property_gravity>` |
  83. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`float<class_float>` | :ref:`hue_variation<class_CPUParticles_property_hue_variation>` |
  85. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`Curve<class_Curve>` | :ref:`hue_variation_curve<class_CPUParticles_property_hue_variation_curve>` |
  87. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`float<class_float>` | :ref:`hue_variation_random<class_CPUParticles_property_hue_variation_random>` |
  89. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`float<class_float>` | :ref:`initial_velocity<class_CPUParticles_property_initial_velocity>` |
  91. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`float<class_float>` | :ref:`initial_velocity_random<class_CPUParticles_property_initial_velocity_random>` |
  93. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`float<class_float>` | :ref:`lifetime<class_CPUParticles_property_lifetime>` |
  95. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`float<class_float>` | :ref:`linear_accel<class_CPUParticles_property_linear_accel>` |
  97. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`Curve<class_Curve>` | :ref:`linear_accel_curve<class_CPUParticles_property_linear_accel_curve>` |
  99. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`float<class_float>` | :ref:`linear_accel_random<class_CPUParticles_property_linear_accel_random>` |
  101. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`local_coords<class_CPUParticles_property_local_coords>` |
  103. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  104. | :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_CPUParticles_property_mesh>` |
  105. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`one_shot<class_CPUParticles_property_one_shot>` |
  107. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  108. | :ref:`float<class_float>` | :ref:`preprocess<class_CPUParticles_property_preprocess>` |
  109. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  110. | :ref:`float<class_float>` | :ref:`radial_accel<class_CPUParticles_property_radial_accel>` |
  111. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  112. | :ref:`Curve<class_Curve>` | :ref:`radial_accel_curve<class_CPUParticles_property_radial_accel_curve>` |
  113. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  114. | :ref:`float<class_float>` | :ref:`radial_accel_random<class_CPUParticles_property_radial_accel_random>` |
  115. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  116. | :ref:`float<class_float>` | :ref:`randomness<class_CPUParticles_property_randomness>` |
  117. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`scale_amount<class_CPUParticles_property_scale_amount>` |
  119. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  120. | :ref:`Curve<class_Curve>` | :ref:`scale_amount_curve<class_CPUParticles_property_scale_amount_curve>` |
  121. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  122. | :ref:`float<class_float>` | :ref:`scale_amount_random<class_CPUParticles_property_scale_amount_random>` |
  123. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  124. | :ref:`float<class_float>` | :ref:`speed_scale<class_CPUParticles_property_speed_scale>` |
  125. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  126. | :ref:`float<class_float>` | :ref:`spread<class_CPUParticles_property_spread>` |
  127. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  128. | :ref:`float<class_float>` | :ref:`tangential_accel<class_CPUParticles_property_tangential_accel>` |
  129. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  130. | :ref:`Curve<class_Curve>` | :ref:`tangential_accel_curve<class_CPUParticles_property_tangential_accel_curve>` |
  131. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  132. | :ref:`float<class_float>` | :ref:`tangential_accel_random<class_CPUParticles_property_tangential_accel_random>` |
  133. +-------------------------------------------------------+-------------------------------------------------------------------------------------+
  134. Methods
  135. -------
  136. +------+-------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`convert_from_particles<class_CPUParticles_method_convert_from_particles>` **(** :ref:`Node<class_Node>` particles **)** |
  138. +------+-------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`restart<class_CPUParticles_method_restart>` **(** **)** |
  140. +------+-------------------------------------------------------------------------------------------------------------------------------+
  141. Enumerations
  142. ------------
  143. .. _enum_CPUParticles_DrawOrder:
  144. .. _class_CPUParticles_constant_DRAW_ORDER_INDEX:
  145. .. _class_CPUParticles_constant_DRAW_ORDER_LIFETIME:
  146. .. _class_CPUParticles_constant_DRAW_ORDER_VIEW_DEPTH:
  147. enum **DrawOrder**:
  148. - **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted.
  149. - **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime.
  150. - **DRAW_ORDER_VIEW_DEPTH** = **2** --- Particles are drawn in order of depth.
  151. ----
  152. .. _enum_CPUParticles_Parameter:
  153. .. _class_CPUParticles_constant_PARAM_INITIAL_LINEAR_VELOCITY:
  154. .. _class_CPUParticles_constant_PARAM_ANGULAR_VELOCITY:
  155. .. _class_CPUParticles_constant_PARAM_LINEAR_ACCEL:
  156. .. _class_CPUParticles_constant_PARAM_RADIAL_ACCEL:
  157. .. _class_CPUParticles_constant_PARAM_TANGENTIAL_ACCEL:
  158. .. _class_CPUParticles_constant_PARAM_DAMPING:
  159. .. _class_CPUParticles_constant_PARAM_ANGLE:
  160. .. _class_CPUParticles_constant_PARAM_SCALE:
  161. .. _class_CPUParticles_constant_PARAM_HUE_VARIATION:
  162. .. _class_CPUParticles_constant_PARAM_ANIM_SPEED:
  163. .. _class_CPUParticles_constant_PARAM_ANIM_OFFSET:
  164. .. _class_CPUParticles_constant_PARAM_MAX:
  165. enum **Parameter**:
  166. - **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set initial velocity properties.
  167. - **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set angular velocity properties.
  168. - **PARAM_LINEAR_ACCEL** = **2** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set linear acceleration properties.
  169. - **PARAM_RADIAL_ACCEL** = **3** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set radial acceleration properties.
  170. - **PARAM_TANGENTIAL_ACCEL** = **4** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set tangential acceleration properties.
  171. - **PARAM_DAMPING** = **5** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set damping properties.
  172. - **PARAM_ANGLE** = **6** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set angle properties.
  173. - **PARAM_SCALE** = **7** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set scale properties.
  174. - **PARAM_HUE_VARIATION** = **8** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set hue variation properties.
  175. - **PARAM_ANIM_SPEED** = **9** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set animation speed properties.
  176. - **PARAM_ANIM_OFFSET** = **10** --- Use with :ref:`set_param<class_CPUParticles_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles_method_set_param_randomness>`, and :ref:`set_param_texture<class_CPUParticles_method_set_param_texture>` to set animation offset properties.
  177. - **PARAM_MAX** = **11** --- Represents the size of the :ref:`Parameter<enum_CPUParticles_Parameter>` enum.
  178. ----
  179. .. _enum_CPUParticles_Flags:
  180. .. _class_CPUParticles_constant_FLAG_ALIGN_Y_TO_VELOCITY:
  181. .. _class_CPUParticles_constant_FLAG_ROTATE_Y:
  182. .. _class_CPUParticles_constant_FLAG_MAX:
  183. enum **Flags**:
  184. - **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_flag<class_CPUParticles_method_set_flag>` to set :ref:`flag_align_y<class_CPUParticles_property_flag_align_y>`.
  185. - **FLAG_ROTATE_Y** = **1** --- Use with :ref:`set_flag<class_CPUParticles_method_set_flag>` to set :ref:`flag_rotate_y<class_CPUParticles_property_flag_rotate_y>`.
  186. - **FLAG_MAX** = **3** --- Represents the size of the :ref:`Flags<enum_CPUParticles_Flags>` enum.
  187. ----
  188. .. _enum_CPUParticles_EmissionShape:
  189. .. _class_CPUParticles_constant_EMISSION_SHAPE_POINT:
  190. .. _class_CPUParticles_constant_EMISSION_SHAPE_SPHERE:
  191. .. _class_CPUParticles_constant_EMISSION_SHAPE_BOX:
  192. .. _class_CPUParticles_constant_EMISSION_SHAPE_POINTS:
  193. .. _class_CPUParticles_constant_EMISSION_SHAPE_DIRECTED_POINTS:
  194. enum **EmissionShape**:
  195. - **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point.
  196. - **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere.
  197. - **EMISSION_SHAPE_BOX** = **2** --- Particles will be emitted in the volume of a box.
  198. - **EMISSION_SHAPE_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points<class_CPUParticles_property_emission_points>`. Particle color will be modulated by :ref:`emission_colors<class_CPUParticles_property_emission_colors>`.
  199. - **EMISSION_SHAPE_DIRECTED_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points<class_CPUParticles_property_emission_points>`. Particle velocity and rotation will be set based on :ref:`emission_normals<class_CPUParticles_property_emission_normals>`. Particle color will be modulated by :ref:`emission_colors<class_CPUParticles_property_emission_colors>`.
  200. Description
  201. -----------
  202. CPU-based 3D particle node used to create a variety of particle systems and effects.
  203. See also :ref:`Particles<class_Particles>`, which provides the same functionality with hardware acceleration, but may not run on older devices.
  204. Property Descriptions
  205. ---------------------
  206. .. _class_CPUParticles_property_amount:
  207. - :ref:`int<class_int>` **amount**
  208. +----------+-------------------+
  209. | *Setter* | set_amount(value) |
  210. +----------+-------------------+
  211. | *Getter* | get_amount() |
  212. +----------+-------------------+
  213. Number of particles emitted in one emission cycle.
  214. ----
  215. .. _class_CPUParticles_property_angle:
  216. - :ref:`float<class_float>` **angle**
  217. +----------+------------------+
  218. | *Setter* | set_param(value) |
  219. +----------+------------------+
  220. | *Getter* | get_param() |
  221. +----------+------------------+
  222. Initial rotation applied to each particle, in degrees.
  223. ----
  224. .. _class_CPUParticles_property_angle_curve:
  225. - :ref:`Curve<class_Curve>` **angle_curve**
  226. +----------+------------------------+
  227. | *Setter* | set_param_curve(value) |
  228. +----------+------------------------+
  229. | *Getter* | get_param_curve() |
  230. +----------+------------------------+
  231. Each particle's rotation will be animated along this :ref:`Curve<class_Curve>`.
  232. ----
  233. .. _class_CPUParticles_property_angle_random:
  234. - :ref:`float<class_float>` **angle_random**
  235. +----------+-----------------------------+
  236. | *Setter* | set_param_randomness(value) |
  237. +----------+-----------------------------+
  238. | *Getter* | get_param_randomness() |
  239. +----------+-----------------------------+
  240. Rotation randomness ratio. Default value: ``0``.
  241. ----
  242. .. _class_CPUParticles_property_angular_velocity:
  243. - :ref:`float<class_float>` **angular_velocity**
  244. +----------+------------------+
  245. | *Setter* | set_param(value) |
  246. +----------+------------------+
  247. | *Getter* | get_param() |
  248. +----------+------------------+
  249. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
  250. ----
  251. .. _class_CPUParticles_property_angular_velocity_curve:
  252. - :ref:`Curve<class_Curve>` **angular_velocity_curve**
  253. +----------+------------------------+
  254. | *Setter* | set_param_curve(value) |
  255. +----------+------------------------+
  256. | *Getter* | get_param_curve() |
  257. +----------+------------------------+
  258. Each particle's angular velocity will vary along this :ref:`Curve<class_Curve>`.
  259. ----
  260. .. _class_CPUParticles_property_angular_velocity_random:
  261. - :ref:`float<class_float>` **angular_velocity_random**
  262. +----------+-----------------------------+
  263. | *Setter* | set_param_randomness(value) |
  264. +----------+-----------------------------+
  265. | *Getter* | get_param_randomness() |
  266. +----------+-----------------------------+
  267. Angular velocity randomness ratio. Default value: ``0``.
  268. ----
  269. .. _class_CPUParticles_property_anim_offset:
  270. - :ref:`float<class_float>` **anim_offset**
  271. +----------+------------------+
  272. | *Setter* | set_param(value) |
  273. +----------+------------------+
  274. | *Getter* | get_param() |
  275. +----------+------------------+
  276. Particle animation offset.
  277. ----
  278. .. _class_CPUParticles_property_anim_offset_curve:
  279. - :ref:`Curve<class_Curve>` **anim_offset_curve**
  280. +----------+------------------------+
  281. | *Setter* | set_param_curve(value) |
  282. +----------+------------------------+
  283. | *Getter* | get_param_curve() |
  284. +----------+------------------------+
  285. Each particle's animation offset will vary along this :ref:`Curve<class_Curve>`.
  286. ----
  287. .. _class_CPUParticles_property_anim_offset_random:
  288. - :ref:`float<class_float>` **anim_offset_random**
  289. +----------+-----------------------------+
  290. | *Setter* | set_param_randomness(value) |
  291. +----------+-----------------------------+
  292. | *Getter* | get_param_randomness() |
  293. +----------+-----------------------------+
  294. Animation offset randomness ratio. Default value: ``0``.
  295. ----
  296. .. _class_CPUParticles_property_anim_speed:
  297. - :ref:`float<class_float>` **anim_speed**
  298. +----------+------------------+
  299. | *Setter* | set_param(value) |
  300. +----------+------------------+
  301. | *Getter* | get_param() |
  302. +----------+------------------+
  303. Particle animation speed.
  304. ----
  305. .. _class_CPUParticles_property_anim_speed_curve:
  306. - :ref:`Curve<class_Curve>` **anim_speed_curve**
  307. +----------+------------------------+
  308. | *Setter* | set_param_curve(value) |
  309. +----------+------------------------+
  310. | *Getter* | get_param_curve() |
  311. +----------+------------------------+
  312. Each particle's animation speed will vary along this :ref:`Curve<class_Curve>`.
  313. ----
  314. .. _class_CPUParticles_property_anim_speed_random:
  315. - :ref:`float<class_float>` **anim_speed_random**
  316. +----------+-----------------------------+
  317. | *Setter* | set_param_randomness(value) |
  318. +----------+-----------------------------+
  319. | *Getter* | get_param_randomness() |
  320. +----------+-----------------------------+
  321. Animation speed randomness ratio. Default value: ``0``.
  322. ----
  323. .. _class_CPUParticles_property_color:
  324. - :ref:`Color<class_Color>` **color**
  325. +----------+------------------+
  326. | *Setter* | set_color(value) |
  327. +----------+------------------+
  328. | *Getter* | get_color() |
  329. +----------+------------------+
  330. Unused for 3D particles.
  331. ----
  332. .. _class_CPUParticles_property_color_ramp:
  333. - :ref:`Gradient<class_Gradient>` **color_ramp**
  334. +----------+-----------------------+
  335. | *Setter* | set_color_ramp(value) |
  336. +----------+-----------------------+
  337. | *Getter* | get_color_ramp() |
  338. +----------+-----------------------+
  339. Unused for 3D particles.
  340. ----
  341. .. _class_CPUParticles_property_damping:
  342. - :ref:`float<class_float>` **damping**
  343. +----------+------------------+
  344. | *Setter* | set_param(value) |
  345. +----------+------------------+
  346. | *Getter* | get_param() |
  347. +----------+------------------+
  348. The rate at which particles lose velocity.
  349. ----
  350. .. _class_CPUParticles_property_damping_curve:
  351. - :ref:`Curve<class_Curve>` **damping_curve**
  352. +----------+------------------------+
  353. | *Setter* | set_param_curve(value) |
  354. +----------+------------------------+
  355. | *Getter* | get_param_curve() |
  356. +----------+------------------------+
  357. Damping will vary along this :ref:`Curve<class_Curve>`.
  358. ----
  359. .. _class_CPUParticles_property_damping_random:
  360. - :ref:`float<class_float>` **damping_random**
  361. +----------+-----------------------------+
  362. | *Setter* | set_param_randomness(value) |
  363. +----------+-----------------------------+
  364. | *Getter* | get_param_randomness() |
  365. +----------+-----------------------------+
  366. Damping randomness ratio. Default value: ``0``.
  367. ----
  368. .. _class_CPUParticles_property_draw_order:
  369. - :ref:`DrawOrder<enum_CPUParticles_DrawOrder>` **draw_order**
  370. +----------+-----------------------+
  371. | *Setter* | set_draw_order(value) |
  372. +----------+-----------------------+
  373. | *Getter* | get_draw_order() |
  374. +----------+-----------------------+
  375. Particle draw order. Uses :ref:`DrawOrder<enum_CPUParticles_DrawOrder>` values. Default value: :ref:`DRAW_ORDER_INDEX<class_CPUParticles_constant_DRAW_ORDER_INDEX>`.
  376. ----
  377. .. _class_CPUParticles_property_emission_box_extents:
  378. - :ref:`Vector3<class_Vector3>` **emission_box_extents**
  379. +----------+---------------------------------+
  380. | *Setter* | set_emission_box_extents(value) |
  381. +----------+---------------------------------+
  382. | *Getter* | get_emission_box_extents() |
  383. +----------+---------------------------------+
  384. The rectangle's extents if :ref:`emission_shape<class_CPUParticles_property_emission_shape>` is set to :ref:`EMISSION_SHAPE_BOX<class_CPUParticles_constant_EMISSION_SHAPE_BOX>`.
  385. ----
  386. .. _class_CPUParticles_property_emission_colors:
  387. - :ref:`PoolColorArray<class_PoolColorArray>` **emission_colors**
  388. +----------+----------------------------+
  389. | *Setter* | set_emission_colors(value) |
  390. +----------+----------------------------+
  391. | *Getter* | get_emission_colors() |
  392. +----------+----------------------------+
  393. ----
  394. .. _class_CPUParticles_property_emission_normals:
  395. - :ref:`PoolVector3Array<class_PoolVector3Array>` **emission_normals**
  396. +----------+-----------------------------+
  397. | *Setter* | set_emission_normals(value) |
  398. +----------+-----------------------------+
  399. | *Getter* | get_emission_normals() |
  400. +----------+-----------------------------+
  401. ----
  402. .. _class_CPUParticles_property_emission_points:
  403. - :ref:`PoolVector3Array<class_PoolVector3Array>` **emission_points**
  404. +----------+----------------------------+
  405. | *Setter* | set_emission_points(value) |
  406. +----------+----------------------------+
  407. | *Getter* | get_emission_points() |
  408. +----------+----------------------------+
  409. ----
  410. .. _class_CPUParticles_property_emission_shape:
  411. - :ref:`EmissionShape<enum_CPUParticles_EmissionShape>` **emission_shape**
  412. +----------+---------------------------+
  413. | *Setter* | set_emission_shape(value) |
  414. +----------+---------------------------+
  415. | *Getter* | get_emission_shape() |
  416. +----------+---------------------------+
  417. Particles will be emitted inside this region. Use :ref:`EmissionShape<enum_CPUParticles_EmissionShape>` for values. Default value: :ref:`EMISSION_SHAPE_POINT<class_CPUParticles_constant_EMISSION_SHAPE_POINT>`.
  418. ----
  419. .. _class_CPUParticles_property_emission_sphere_radius:
  420. - :ref:`float<class_float>` **emission_sphere_radius**
  421. +----------+-----------------------------------+
  422. | *Setter* | set_emission_sphere_radius(value) |
  423. +----------+-----------------------------------+
  424. | *Getter* | get_emission_sphere_radius() |
  425. +----------+-----------------------------------+
  426. The sphere's radius if :ref:`EmissionShape<enum_CPUParticles_EmissionShape>` is set to :ref:`EMISSION_SHAPE_SPHERE<class_CPUParticles_constant_EMISSION_SHAPE_SPHERE>`.
  427. ----
  428. .. _class_CPUParticles_property_emitting:
  429. - :ref:`bool<class_bool>` **emitting**
  430. +----------+---------------------+
  431. | *Setter* | set_emitting(value) |
  432. +----------+---------------------+
  433. | *Getter* | is_emitting() |
  434. +----------+---------------------+
  435. If ``true``, particles are being emitted. Default value: ``true``.
  436. ----
  437. .. _class_CPUParticles_property_explosiveness:
  438. - :ref:`float<class_float>` **explosiveness**
  439. +----------+--------------------------------+
  440. | *Setter* | set_explosiveness_ratio(value) |
  441. +----------+--------------------------------+
  442. | *Getter* | get_explosiveness_ratio() |
  443. +----------+--------------------------------+
  444. How rapidly particles in an emission cycle are emitted. If greater than ``0``, there will be a gap in emissions before the next cycle begins. Default value: ``0``.
  445. ----
  446. .. _class_CPUParticles_property_fixed_fps:
  447. - :ref:`int<class_int>` **fixed_fps**
  448. +----------+----------------------+
  449. | *Setter* | set_fixed_fps(value) |
  450. +----------+----------------------+
  451. | *Getter* | get_fixed_fps() |
  452. +----------+----------------------+
  453. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself.
  454. ----
  455. .. _class_CPUParticles_property_flag_align_y:
  456. - :ref:`bool<class_bool>` **flag_align_y**
  457. +----------+--------------------------+
  458. | *Setter* | set_particle_flag(value) |
  459. +----------+--------------------------+
  460. | *Getter* | get_particle_flag() |
  461. +----------+--------------------------+
  462. Align y-axis of particle with the direction of its velocity.
  463. ----
  464. .. _class_CPUParticles_property_flag_disable_z:
  465. - :ref:`bool<class_bool>` **flag_disable_z**
  466. +----------+--------------------------+
  467. | *Setter* | set_particle_flag(value) |
  468. +----------+--------------------------+
  469. | *Getter* | get_particle_flag() |
  470. +----------+--------------------------+
  471. If ``true``, particles will not move on the z axis. Default value: ``false``.
  472. ----
  473. .. _class_CPUParticles_property_flag_rotate_y:
  474. - :ref:`bool<class_bool>` **flag_rotate_y**
  475. +----------+--------------------------+
  476. | *Setter* | set_particle_flag(value) |
  477. +----------+--------------------------+
  478. | *Getter* | get_particle_flag() |
  479. +----------+--------------------------+
  480. If ``true``, particles rotate around y-axis by :ref:`angle<class_CPUParticles_property_angle>`.
  481. ----
  482. .. _class_CPUParticles_property_flatness:
  483. - :ref:`float<class_float>` **flatness**
  484. +----------+---------------------+
  485. | *Setter* | set_flatness(value) |
  486. +----------+---------------------+
  487. | *Getter* | get_flatness() |
  488. +----------+---------------------+
  489. Amount of :ref:`spread<class_CPUParticles_property_spread>` in Y/Z plane. A value of ``1`` restricts particles to X/Z plane. Default ``0``.
  490. ----
  491. .. _class_CPUParticles_property_fract_delta:
  492. - :ref:`bool<class_bool>` **fract_delta**
  493. +----------+-----------------------------+
  494. | *Setter* | set_fractional_delta(value) |
  495. +----------+-----------------------------+
  496. | *Getter* | get_fractional_delta() |
  497. +----------+-----------------------------+
  498. If ``true``, results in fractional delta calculation which has a smoother particles display effect. Default value: ``true``
  499. ----
  500. .. _class_CPUParticles_property_gravity:
  501. - :ref:`Vector3<class_Vector3>` **gravity**
  502. +----------+--------------------+
  503. | *Setter* | set_gravity(value) |
  504. +----------+--------------------+
  505. | *Getter* | get_gravity() |
  506. +----------+--------------------+
  507. Gravity applied to every particle. Default value: ``(0, -9.8, 0)``.
  508. ----
  509. .. _class_CPUParticles_property_hue_variation:
  510. - :ref:`float<class_float>` **hue_variation**
  511. +----------+------------------+
  512. | *Setter* | set_param(value) |
  513. +----------+------------------+
  514. | *Getter* | get_param() |
  515. +----------+------------------+
  516. Initial hue variation applied to each particle.
  517. ----
  518. .. _class_CPUParticles_property_hue_variation_curve:
  519. - :ref:`Curve<class_Curve>` **hue_variation_curve**
  520. +----------+------------------------+
  521. | *Setter* | set_param_curve(value) |
  522. +----------+------------------------+
  523. | *Getter* | get_param_curve() |
  524. +----------+------------------------+
  525. Each particle's hue will vary along this :ref:`Curve<class_Curve>`.
  526. ----
  527. .. _class_CPUParticles_property_hue_variation_random:
  528. - :ref:`float<class_float>` **hue_variation_random**
  529. +----------+-----------------------------+
  530. | *Setter* | set_param_randomness(value) |
  531. +----------+-----------------------------+
  532. | *Getter* | get_param_randomness() |
  533. +----------+-----------------------------+
  534. Hue variation randomness ratio. Default value: ``0``.
  535. ----
  536. .. _class_CPUParticles_property_initial_velocity:
  537. - :ref:`float<class_float>` **initial_velocity**
  538. +----------+------------------+
  539. | *Setter* | set_param(value) |
  540. +----------+------------------+
  541. | *Getter* | get_param() |
  542. +----------+------------------+
  543. Initial velocity magnitude for each particle. Direction comes from :ref:`spread<class_CPUParticles_property_spread>` and the node's orientation.
  544. ----
  545. .. _class_CPUParticles_property_initial_velocity_random:
  546. - :ref:`float<class_float>` **initial_velocity_random**
  547. +----------+-----------------------------+
  548. | *Setter* | set_param_randomness(value) |
  549. +----------+-----------------------------+
  550. | *Getter* | get_param_randomness() |
  551. +----------+-----------------------------+
  552. Initial velocity randomness ratio. Default value: ``0``.
  553. ----
  554. .. _class_CPUParticles_property_lifetime:
  555. - :ref:`float<class_float>` **lifetime**
  556. +----------+---------------------+
  557. | *Setter* | set_lifetime(value) |
  558. +----------+---------------------+
  559. | *Getter* | get_lifetime() |
  560. +----------+---------------------+
  561. Amount of time each particle will exist. Default value: ``1``.
  562. ----
  563. .. _class_CPUParticles_property_linear_accel:
  564. - :ref:`float<class_float>` **linear_accel**
  565. +----------+------------------+
  566. | *Setter* | set_param(value) |
  567. +----------+------------------+
  568. | *Getter* | get_param() |
  569. +----------+------------------+
  570. Linear acceleration applied to each particle in the direction of motion.
  571. ----
  572. .. _class_CPUParticles_property_linear_accel_curve:
  573. - :ref:`Curve<class_Curve>` **linear_accel_curve**
  574. +----------+------------------------+
  575. | *Setter* | set_param_curve(value) |
  576. +----------+------------------------+
  577. | *Getter* | get_param_curve() |
  578. +----------+------------------------+
  579. Each particle's linear acceleration will vary along this :ref:`Curve<class_Curve>`.
  580. ----
  581. .. _class_CPUParticles_property_linear_accel_random:
  582. - :ref:`float<class_float>` **linear_accel_random**
  583. +----------+-----------------------------+
  584. | *Setter* | set_param_randomness(value) |
  585. +----------+-----------------------------+
  586. | *Getter* | get_param_randomness() |
  587. +----------+-----------------------------+
  588. Linear acceleration randomness ratio. Default value: ``0``.
  589. ----
  590. .. _class_CPUParticles_property_local_coords:
  591. - :ref:`bool<class_bool>` **local_coords**
  592. +----------+----------------------------------+
  593. | *Setter* | set_use_local_coordinates(value) |
  594. +----------+----------------------------------+
  595. | *Getter* | get_use_local_coordinates() |
  596. +----------+----------------------------------+
  597. If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. Default value: ``true``.
  598. ----
  599. .. _class_CPUParticles_property_mesh:
  600. - :ref:`Mesh<class_Mesh>` **mesh**
  601. +----------+-----------------+
  602. | *Setter* | set_mesh(value) |
  603. +----------+-----------------+
  604. | *Getter* | get_mesh() |
  605. +----------+-----------------+
  606. The :ref:`Mesh<class_Mesh>` used for each particle. If ``null``, particles will be spheres.
  607. ----
  608. .. _class_CPUParticles_property_one_shot:
  609. - :ref:`bool<class_bool>` **one_shot**
  610. +----------+---------------------+
  611. | *Setter* | set_one_shot(value) |
  612. +----------+---------------------+
  613. | *Getter* | get_one_shot() |
  614. +----------+---------------------+
  615. If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. Default value: ``false``.
  616. ----
  617. .. _class_CPUParticles_property_preprocess:
  618. - :ref:`float<class_float>` **preprocess**
  619. +----------+-----------------------------+
  620. | *Setter* | set_pre_process_time(value) |
  621. +----------+-----------------------------+
  622. | *Getter* | get_pre_process_time() |
  623. +----------+-----------------------------+
  624. Particle system starts as if it had already run for this many seconds.
  625. ----
  626. .. _class_CPUParticles_property_radial_accel:
  627. - :ref:`float<class_float>` **radial_accel**
  628. +----------+------------------+
  629. | *Setter* | set_param(value) |
  630. +----------+------------------+
  631. | *Getter* | get_param() |
  632. +----------+------------------+
  633. Radial acceleration applied to each particle. Makes particle accelerate away from origin.
  634. ----
  635. .. _class_CPUParticles_property_radial_accel_curve:
  636. - :ref:`Curve<class_Curve>` **radial_accel_curve**
  637. +----------+------------------------+
  638. | *Setter* | set_param_curve(value) |
  639. +----------+------------------------+
  640. | *Getter* | get_param_curve() |
  641. +----------+------------------------+
  642. Each particle's radial acceleration will vary along this :ref:`Curve<class_Curve>`.
  643. ----
  644. .. _class_CPUParticles_property_radial_accel_random:
  645. - :ref:`float<class_float>` **radial_accel_random**
  646. +----------+-----------------------------+
  647. | *Setter* | set_param_randomness(value) |
  648. +----------+-----------------------------+
  649. | *Getter* | get_param_randomness() |
  650. +----------+-----------------------------+
  651. Radial acceleration randomness ratio. Default value: ``0``.
  652. ----
  653. .. _class_CPUParticles_property_randomness:
  654. - :ref:`float<class_float>` **randomness**
  655. +----------+-----------------------------+
  656. | *Setter* | set_randomness_ratio(value) |
  657. +----------+-----------------------------+
  658. | *Getter* | get_randomness_ratio() |
  659. +----------+-----------------------------+
  660. Emission lifetime randomness ratio. Default value: ``0``.
  661. ----
  662. .. _class_CPUParticles_property_scale_amount:
  663. - :ref:`float<class_float>` **scale_amount**
  664. +----------+------------------+
  665. | *Setter* | set_param(value) |
  666. +----------+------------------+
  667. | *Getter* | get_param() |
  668. +----------+------------------+
  669. Initial scale applied to each particle.
  670. ----
  671. .. _class_CPUParticles_property_scale_amount_curve:
  672. - :ref:`Curve<class_Curve>` **scale_amount_curve**
  673. +----------+------------------------+
  674. | *Setter* | set_param_curve(value) |
  675. +----------+------------------------+
  676. | *Getter* | get_param_curve() |
  677. +----------+------------------------+
  678. Each particle's scale will vary along this :ref:`Curve<class_Curve>`.
  679. ----
  680. .. _class_CPUParticles_property_scale_amount_random:
  681. - :ref:`float<class_float>` **scale_amount_random**
  682. +----------+-----------------------------+
  683. | *Setter* | set_param_randomness(value) |
  684. +----------+-----------------------------+
  685. | *Getter* | get_param_randomness() |
  686. +----------+-----------------------------+
  687. Scale randomness ratio. Default value: ``0``.
  688. ----
  689. .. _class_CPUParticles_property_speed_scale:
  690. - :ref:`float<class_float>` **speed_scale**
  691. +----------+------------------------+
  692. | *Setter* | set_speed_scale(value) |
  693. +----------+------------------------+
  694. | *Getter* | get_speed_scale() |
  695. +----------+------------------------+
  696. Particle system's running speed scaling ratio. Default value: ``1``. A value of ``0`` can be used to pause the particles.
  697. ----
  698. .. _class_CPUParticles_property_spread:
  699. - :ref:`float<class_float>` **spread**
  700. +----------+-------------------+
  701. | *Setter* | set_spread(value) |
  702. +----------+-------------------+
  703. | *Getter* | get_spread() |
  704. +----------+-------------------+
  705. Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. Default value: ``45``.
  706. ----
  707. .. _class_CPUParticles_property_tangential_accel:
  708. - :ref:`float<class_float>` **tangential_accel**
  709. +----------+------------------+
  710. | *Setter* | set_param(value) |
  711. +----------+------------------+
  712. | *Getter* | get_param() |
  713. +----------+------------------+
  714. Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
  715. ----
  716. .. _class_CPUParticles_property_tangential_accel_curve:
  717. - :ref:`Curve<class_Curve>` **tangential_accel_curve**
  718. +----------+------------------------+
  719. | *Setter* | set_param_curve(value) |
  720. +----------+------------------------+
  721. | *Getter* | get_param_curve() |
  722. +----------+------------------------+
  723. Each particle's tangential acceleration will vary along this :ref:`Curve<class_Curve>`.
  724. ----
  725. .. _class_CPUParticles_property_tangential_accel_random:
  726. - :ref:`float<class_float>` **tangential_accel_random**
  727. +----------+-----------------------------+
  728. | *Setter* | set_param_randomness(value) |
  729. +----------+-----------------------------+
  730. | *Getter* | get_param_randomness() |
  731. +----------+-----------------------------+
  732. Tangential acceleration randomness ratio. Default value: ``0``.
  733. Method Descriptions
  734. -------------------
  735. .. _class_CPUParticles_method_convert_from_particles:
  736. - void **convert_from_particles** **(** :ref:`Node<class_Node>` particles **)**
  737. Sets this node's properties to match a given :ref:`Particles<class_Particles>` node with an assigned :ref:`ParticlesMaterial<class_ParticlesMaterial>`.
  738. ----
  739. .. _class_CPUParticles_method_restart:
  740. - void **restart** **(** **)**
  741. Restarts the particle emitter.