CPUParticles.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CPUParticles" inherits="GeometryInstance" category="Core" version="3.1.2">
  3. <brief_description>
  4. CPU-based 3D particle emitter.
  5. </brief_description>
  6. <description>
  7. CPU-based 3D particle node used to create a variety of particle systems and effects.
  8. See also [Particles], which provides the same functionality with hardware acceleration, but may not run on older devices.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="convert_from_particles">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="particles" type="Node">
  17. </argument>
  18. <description>
  19. Sets this node's properties to match a given [Particles] node with an assigned [ParticlesMaterial].
  20. </description>
  21. </method>
  22. <method name="restart">
  23. <return type="void">
  24. </return>
  25. <description>
  26. Restarts the particle emitter.
  27. </description>
  28. </method>
  29. </methods>
  30. <members>
  31. <member name="amount" type="int" setter="set_amount" getter="get_amount">
  32. Number of particles emitted in one emission cycle.
  33. </member>
  34. <member name="angle" type="float" setter="set_param" getter="get_param">
  35. Initial rotation applied to each particle, in degrees.
  36. </member>
  37. <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  38. Each particle's rotation will be animated along this [Curve].
  39. </member>
  40. <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  41. Rotation randomness ratio. Default value: [code]0[/code].
  42. </member>
  43. <member name="angular_velocity" type="float" setter="set_param" getter="get_param">
  44. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
  45. </member>
  46. <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  47. Each particle's angular velocity will vary along this [Curve].
  48. </member>
  49. <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  50. Angular velocity randomness ratio. Default value: [code]0[/code].
  51. </member>
  52. <member name="anim_offset" type="float" setter="set_param" getter="get_param">
  53. Particle animation offset.
  54. </member>
  55. <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  56. Each particle's animation offset will vary along this [Curve].
  57. </member>
  58. <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  59. Animation offset randomness ratio. Default value: [code]0[/code].
  60. </member>
  61. <member name="anim_speed" type="float" setter="set_param" getter="get_param">
  62. Particle animation speed.
  63. </member>
  64. <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  65. Each particle's animation speed will vary along this [Curve].
  66. </member>
  67. <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  68. Animation speed randomness ratio. Default value: [code]0[/code].
  69. </member>
  70. <member name="color" type="Color" setter="set_color" getter="get_color">
  71. Unused for 3D particles.
  72. </member>
  73. <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp">
  74. Unused for 3D particles.
  75. </member>
  76. <member name="damping" type="float" setter="set_param" getter="get_param">
  77. The rate at which particles lose velocity.
  78. </member>
  79. <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  80. Damping will vary along this [Curve].
  81. </member>
  82. <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  83. Damping randomness ratio. Default value: [code]0[/code].
  84. </member>
  85. <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="CPUParticles.DrawOrder">
  86. Particle draw order. Uses [enum DrawOrder] values. Default value: [constant DRAW_ORDER_INDEX].
  87. </member>
  88. <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents">
  89. The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX].
  90. </member>
  91. <member name="emission_colors" type="PoolColorArray" setter="set_emission_colors" getter="get_emission_colors">
  92. </member>
  93. <member name="emission_normals" type="PoolVector3Array" setter="set_emission_normals" getter="get_emission_normals">
  94. </member>
  95. <member name="emission_points" type="PoolVector3Array" setter="set_emission_points" getter="get_emission_points">
  96. </member>
  97. <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="CPUParticles.EmissionShape">
  98. Particles will be emitted inside this region. Use [enum EmissionShape] for values. Default value: [constant EMISSION_SHAPE_POINT].
  99. </member>
  100. <member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
  101. The sphere's radius if [enum EmissionShape] is set to [constant EMISSION_SHAPE_SPHERE].
  102. </member>
  103. <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting">
  104. If [code]true[/code], particles are being emitted. Default value: [code]true[/code].
  105. </member>
  106. <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio">
  107. How rapidly particles in an emission cycle are emitted. If greater than [code]0[/code], there will be a gap in emissions before the next cycle begins. Default value: [code]0[/code].
  108. </member>
  109. <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps">
  110. 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.
  111. </member>
  112. <member name="flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag">
  113. Align y-axis of particle with the direction of its velocity.
  114. </member>
  115. <member name="flag_disable_z" type="bool" setter="set_particle_flag" getter="get_particle_flag">
  116. If [code]true[/code], particles will not move on the z axis. Default value: [code]false[/code].
  117. </member>
  118. <member name="flag_rotate_y" type="bool" setter="set_particle_flag" getter="get_particle_flag">
  119. If [code]true[/code], particles rotate around y-axis by [member angle].
  120. </member>
  121. <member name="flatness" type="float" setter="set_flatness" getter="get_flatness">
  122. Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane. Default [code]0[/code].
  123. </member>
  124. <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta">
  125. If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. Default value: [code]true[/code]
  126. </member>
  127. <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity">
  128. Gravity applied to every particle. Default value: [code](0, -9.8, 0)[/code].
  129. </member>
  130. <member name="hue_variation" type="float" setter="set_param" getter="get_param">
  131. Initial hue variation applied to each particle.
  132. </member>
  133. <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  134. Each particle's hue will vary along this [Curve].
  135. </member>
  136. <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  137. Hue variation randomness ratio. Default value: [code]0[/code].
  138. </member>
  139. <member name="initial_velocity" type="float" setter="set_param" getter="get_param">
  140. Initial velocity magnitude for each particle. Direction comes from [member spread] and the node's orientation.
  141. </member>
  142. <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  143. Initial velocity randomness ratio. Default value: [code]0[/code].
  144. </member>
  145. <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime">
  146. Amount of time each particle will exist. Default value: [code]1[/code].
  147. </member>
  148. <member name="linear_accel" type="float" setter="set_param" getter="get_param">
  149. Linear acceleration applied to each particle in the direction of motion.
  150. </member>
  151. <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  152. Each particle's linear acceleration will vary along this [Curve].
  153. </member>
  154. <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  155. Linear acceleration randomness ratio. Default value: [code]0[/code].
  156. </member>
  157. <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates">
  158. 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].
  159. </member>
  160. <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh">
  161. The [Mesh] used for each particle. If [code]null[/code], particles will be spheres.
  162. </member>
  163. <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot">
  164. If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end. Default value: [code]false[/code].
  165. </member>
  166. <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time">
  167. Particle system starts as if it had already run for this many seconds.
  168. </member>
  169. <member name="radial_accel" type="float" setter="set_param" getter="get_param">
  170. Radial acceleration applied to each particle. Makes particle accelerate away from origin.
  171. </member>
  172. <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  173. Each particle's radial acceleration will vary along this [Curve].
  174. </member>
  175. <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  176. Radial acceleration randomness ratio. Default value: [code]0[/code].
  177. </member>
  178. <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio">
  179. Emission lifetime randomness ratio. Default value: [code]0[/code].
  180. </member>
  181. <member name="scale_amount" type="float" setter="set_param" getter="get_param">
  182. Initial scale applied to each particle.
  183. </member>
  184. <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  185. Each particle's scale will vary along this [Curve].
  186. </member>
  187. <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  188. Scale randomness ratio. Default value: [code]0[/code].
  189. </member>
  190. <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale">
  191. Particle system's running speed scaling ratio. Default value: [code]1[/code]. A value of [code]0[/code] can be used to pause the particles.
  192. </member>
  193. <member name="spread" type="float" setter="set_spread" getter="get_spread">
  194. Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Default value: [code]45[/code].
  195. </member>
  196. <member name="tangential_accel" type="float" setter="set_param" getter="get_param">
  197. Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
  198. </member>
  199. <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve">
  200. Each particle's tangential acceleration will vary along this [Curve].
  201. </member>
  202. <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  203. Tangential acceleration randomness ratio. Default value: [code]0[/code].
  204. </member>
  205. </members>
  206. <constants>
  207. <constant name="DRAW_ORDER_INDEX" value="0" enum="DrawOrder">
  208. Particles are drawn in the order emitted.
  209. </constant>
  210. <constant name="DRAW_ORDER_LIFETIME" value="1" enum="DrawOrder">
  211. Particles are drawn in order of remaining lifetime.
  212. </constant>
  213. <constant name="DRAW_ORDER_VIEW_DEPTH" value="2" enum="DrawOrder">
  214. Particles are drawn in order of depth.
  215. </constant>
  216. <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
  217. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties.
  218. </constant>
  219. <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
  220. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties.
  221. </constant>
  222. <constant name="PARAM_LINEAR_ACCEL" value="2" enum="Parameter">
  223. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties.
  224. </constant>
  225. <constant name="PARAM_RADIAL_ACCEL" value="3" enum="Parameter">
  226. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties.
  227. </constant>
  228. <constant name="PARAM_TANGENTIAL_ACCEL" value="4" enum="Parameter">
  229. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties.
  230. </constant>
  231. <constant name="PARAM_DAMPING" value="5" enum="Parameter">
  232. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties.
  233. </constant>
  234. <constant name="PARAM_ANGLE" value="6" enum="Parameter">
  235. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties.
  236. </constant>
  237. <constant name="PARAM_SCALE" value="7" enum="Parameter">
  238. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties.
  239. </constant>
  240. <constant name="PARAM_HUE_VARIATION" value="8" enum="Parameter">
  241. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties.
  242. </constant>
  243. <constant name="PARAM_ANIM_SPEED" value="9" enum="Parameter">
  244. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties.
  245. </constant>
  246. <constant name="PARAM_ANIM_OFFSET" value="10" enum="Parameter">
  247. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties.
  248. </constant>
  249. <constant name="PARAM_MAX" value="11" enum="Parameter">
  250. Represents the size of the [enum Parameter] enum.
  251. </constant>
  252. <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
  253. Use with [method set_flag] to set [member flag_align_y].
  254. </constant>
  255. <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
  256. Use with [method set_flag] to set [member flag_rotate_y].
  257. </constant>
  258. <constant name="FLAG_MAX" value="3" enum="Flags">
  259. Represents the size of the [enum Flags] enum.
  260. </constant>
  261. <constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
  262. All particles will be emitted from a single point.
  263. </constant>
  264. <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape">
  265. Particles will be emitted in the volume of a sphere.
  266. </constant>
  267. <constant name="EMISSION_SHAPE_BOX" value="2" enum="EmissionShape">
  268. Particles will be emitted in the volume of a box.
  269. </constant>
  270. <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape">
  271. Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors].
  272. </constant>
  273. <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape">
  274. Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors].
  275. </constant>
  276. </constants>
  277. </class>