class_particlesmaterial.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ParticlesMaterial.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ParticlesMaterial:
  5. ParticlesMaterial
  6. =================
  7. **Inherits:** :ref:`Material<class_material>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Particle properties for :ref:`Particles<class_particles>` and :ref:`Particles2D<class_particles2d>` nodes.
  12. Member Variables
  13. ----------------
  14. .. _class_ParticlesMaterial_angle:
  15. - :ref:`float<class_float>` **angle** - Initial rotation applied to each particle.
  16. .. _class_ParticlesMaterial_angle_curve:
  17. - :ref:`Texture<class_texture>` **angle_curve** - Each particle's rotation will be animated along this :ref:`CurveTexture<class_curvetexture>`.
  18. .. _class_ParticlesMaterial_angle_random:
  19. - :ref:`float<class_float>` **angle_random** - Rotation randomness ratio. Default value: ``0``.
  20. .. _class_ParticlesMaterial_angular_velocity:
  21. - :ref:`float<class_float>` **angular_velocity** - Initial angular velocity applied to each particle.
  22. .. _class_ParticlesMaterial_angular_velocity_curve:
  23. - :ref:`Texture<class_texture>` **angular_velocity_curve** - Each particle's angular velocity will vary along this :ref:`CurveTexture<class_curvetexture>`.
  24. .. _class_ParticlesMaterial_angular_velocity_random:
  25. - :ref:`float<class_float>` **angular_velocity_random** - Angular velocity randomness ratio. Default value: ``0``.
  26. .. _class_ParticlesMaterial_anim_loop:
  27. - :ref:`bool<class_bool>` **anim_loop** - If ``true`` animation will loop. Default value: ``false``.
  28. .. _class_ParticlesMaterial_anim_offset:
  29. - :ref:`float<class_float>` **anim_offset** - Particle animation offset.
  30. .. _class_ParticlesMaterial_anim_offset_curve:
  31. - :ref:`Texture<class_texture>` **anim_offset_curve** - Each particle's animation offset will vary along this :ref:`CurveTexture<class_curvetexture>`.
  32. .. _class_ParticlesMaterial_anim_offset_random:
  33. - :ref:`float<class_float>` **anim_offset_random** - Animation offset randomness ratio. Default value: ``0``.
  34. .. _class_ParticlesMaterial_anim_speed:
  35. - :ref:`float<class_float>` **anim_speed** - Particle animation speed.
  36. .. _class_ParticlesMaterial_anim_speed_curve:
  37. - :ref:`Texture<class_texture>` **anim_speed_curve** - Each particle's animation speed will vary along this :ref:`CurveTexture<class_curvetexture>`.
  38. .. _class_ParticlesMaterial_anim_speed_random:
  39. - :ref:`float<class_float>` **anim_speed_random** - Animation speed randomness ratio. Default value: ``0``.
  40. .. _class_ParticlesMaterial_color:
  41. - :ref:`Color<class_color>` **color** - Each particle's initial color. If the Particle2D's ``texture`` is defined, it will be multiplied by this color.
  42. .. _class_ParticlesMaterial_color_ramp:
  43. - :ref:`Texture<class_texture>` **color_ramp** - Each particle's color will vary along this :ref:`GradientTexture<class_gradienttexture>`.
  44. .. _class_ParticlesMaterial_damping:
  45. - :ref:`float<class_float>` **damping** - The rate at which particles lose velocity.
  46. .. _class_ParticlesMaterial_damping_curve:
  47. - :ref:`Texture<class_texture>` **damping_curve** - Damping will vary along this :ref:`CurveTexture<class_curvetexture>`.
  48. .. _class_ParticlesMaterial_damping_random:
  49. - :ref:`float<class_float>` **damping_random** - Damping randomness ratio. Default value: ``0``.
  50. .. _class_ParticlesMaterial_emission_box_extents:
  51. - :ref:`Vector3<class_vector3>` **emission_box_extents** - The box's extents if ``emission_shape`` is set to ``EMISSION_SHAPE_BOX``.
  52. .. _class_ParticlesMaterial_emission_color_texture:
  53. - :ref:`Texture<class_texture>` **emission_color_texture**
  54. .. _class_ParticlesMaterial_emission_normal_texture:
  55. - :ref:`Texture<class_texture>` **emission_normal_texture**
  56. .. _class_ParticlesMaterial_emission_point_count:
  57. - :ref:`int<class_int>` **emission_point_count** - The number of emission points if ``emission_shape`` is set to ``EMISSION_SHAPE_POINTS`` or ``EMISSION_SHAPE_DIRECTED_POINTS``.
  58. .. _class_ParticlesMaterial_emission_point_texture:
  59. - :ref:`Texture<class_texture>` **emission_point_texture**
  60. .. _class_ParticlesMaterial_emission_shape:
  61. - :ref:`EmissionShape<enum_particlesmaterial_emissionshape>` **emission_shape** - Particles will be emitted inside this region. Use ``EMISSION_SHAPE_*`` constants for values. Default value: ``EMISSION_SHAPE_POINT``.
  62. .. _class_ParticlesMaterial_emission_sphere_radius:
  63. - :ref:`float<class_float>` **emission_sphere_radius** - The sphere's radius if ``emission_shape`` is set to ``EMISSION_SHAPE_SPHERE``.
  64. .. _class_ParticlesMaterial_flag_align_y:
  65. - :ref:`bool<class_bool>` **flag_align_y**
  66. .. _class_ParticlesMaterial_flag_disable_z:
  67. - :ref:`bool<class_bool>` **flag_disable_z** - If ``true`` particles will not move on the z axis. Default value: ``true`` for :ref:`Particles2D<class_particles2d>`, ``false`` for :ref:`Particles<class_particles>`.
  68. .. _class_ParticlesMaterial_flag_rotate_y:
  69. - :ref:`bool<class_bool>` **flag_rotate_y**
  70. .. _class_ParticlesMaterial_flatness:
  71. - :ref:`float<class_float>` **flatness**
  72. .. _class_ParticlesMaterial_gravity:
  73. - :ref:`Vector3<class_vector3>` **gravity** - Gravity applied to every particle. Default value: ``(0, 98, 0)``.
  74. .. _class_ParticlesMaterial_hue_variation:
  75. - :ref:`float<class_float>` **hue_variation** - Initial hue variation applied to each particle.
  76. .. _class_ParticlesMaterial_hue_variation_curve:
  77. - :ref:`Texture<class_texture>` **hue_variation_curve** - Each particle's hue will vary along this :ref:`CurveTexture<class_curvetexture>`.
  78. .. _class_ParticlesMaterial_hue_variation_random:
  79. - :ref:`float<class_float>` **hue_variation_random** - Hue variation randomness ratio. Default value: ``0``.
  80. .. _class_ParticlesMaterial_initial_velocity:
  81. - :ref:`float<class_float>` **initial_velocity** - Initial velocity for each particle.
  82. .. _class_ParticlesMaterial_initial_velocity_random:
  83. - :ref:`float<class_float>` **initial_velocity_random** - Initial velocity randomness ratio. Default value: ``0``.
  84. .. _class_ParticlesMaterial_linear_accel:
  85. - :ref:`float<class_float>` **linear_accel** - Linear acceleration applied to each particle.
  86. .. _class_ParticlesMaterial_linear_accel_curve:
  87. - :ref:`Texture<class_texture>` **linear_accel_curve** - Each particle's linear acceleration will vary along this :ref:`CurveTexture<class_curvetexture>`.
  88. .. _class_ParticlesMaterial_linear_accel_random:
  89. - :ref:`float<class_float>` **linear_accel_random** - Linear acceleration randomness ratio. Default value: ``0``.
  90. .. _class_ParticlesMaterial_orbit_velocity:
  91. - :ref:`float<class_float>` **orbit_velocity** - Orbital velocity applied to each particle.
  92. .. _class_ParticlesMaterial_orbit_velocity_curve:
  93. - :ref:`Texture<class_texture>` **orbit_velocity_curve** - Each particle's orbital velocity will vary along this :ref:`CurveTexture<class_curvetexture>`.
  94. .. _class_ParticlesMaterial_orbit_velocity_random:
  95. - :ref:`float<class_float>` **orbit_velocity_random** - Orbital velocity randomness ratio. Default value: ``0``.
  96. .. _class_ParticlesMaterial_radial_accel:
  97. - :ref:`float<class_float>` **radial_accel** - Radial acceleration applied to each particle.
  98. .. _class_ParticlesMaterial_radial_accel_curve:
  99. - :ref:`Texture<class_texture>` **radial_accel_curve** - Each particle's radial acceleration will vary along this :ref:`CurveTexture<class_curvetexture>`.
  100. .. _class_ParticlesMaterial_radial_accel_random:
  101. - :ref:`float<class_float>` **radial_accel_random** - Radial acceleration randomness ratio. Default value: ``0``.
  102. .. _class_ParticlesMaterial_scale:
  103. - :ref:`float<class_float>` **scale** - Initial scale applied to each particle.
  104. .. _class_ParticlesMaterial_scale_curve:
  105. - :ref:`Texture<class_texture>` **scale_curve** - Each particle's scale will vary along this :ref:`CurveTexture<class_curvetexture>`.
  106. .. _class_ParticlesMaterial_scale_random:
  107. - :ref:`float<class_float>` **scale_random** - Scale randomness ratio. Default value: ``0``.
  108. .. _class_ParticlesMaterial_spread:
  109. - :ref:`float<class_float>` **spread** - Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. Default value: ``45``.
  110. .. _class_ParticlesMaterial_tangential_accel:
  111. - :ref:`float<class_float>` **tangential_accel** - Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity.
  112. .. _class_ParticlesMaterial_tangential_accel_curve:
  113. - :ref:`Texture<class_texture>` **tangential_accel_curve** - Each particle's tangential acceleration will vary along this :ref:`CurveTexture<class_curvetexture>`.
  114. .. _class_ParticlesMaterial_tangential_accel_random:
  115. - :ref:`float<class_float>` **tangential_accel_random** - Tangential acceleration randomness ratio. Default value: ``0``.
  116. .. _class_ParticlesMaterial_trail_color_modifier:
  117. - :ref:`GradientTexture<class_gradienttexture>` **trail_color_modifier** - Trail particles' color will vary along this :ref:`GradientTexture<class_gradienttexture>`.
  118. .. _class_ParticlesMaterial_trail_divisor:
  119. - :ref:`int<class_int>` **trail_divisor** - Emitter will emit ``amount`` divided by ``trail_divisor`` particles. The remaining particles will be used as trail(s).
  120. .. _class_ParticlesMaterial_trail_size_modifier:
  121. - :ref:`CurveTexture<class_curvetexture>` **trail_size_modifier** - Trail particles' size will vary along this :ref:`CurveTexture<class_curvetexture>`.
  122. Enums
  123. -----
  124. .. _enum_ParticlesMaterial_Flags:
  125. enum **Flags**
  126. - **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_flag<class_ParticlesMaterial_set_flag>` to set :ref:`flag_align_y<class_ParticlesMaterial_flag_align_y>`.
  127. - **FLAG_ROTATE_Y** = **1** --- Use with :ref:`set_flag<class_ParticlesMaterial_set_flag>` to set :ref:`flag_rotate_y<class_ParticlesMaterial_flag_rotate_y>`
  128. - **FLAG_MAX** = **4**
  129. .. _enum_ParticlesMaterial_Parameter:
  130. enum **Parameter**
  131. - **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set initial velocity properties.
  132. - **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set angular velocity properties.
  133. - **PARAM_ORBIT_VELOCITY** = **2** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set orbital_velocity properties.
  134. - **PARAM_LINEAR_ACCEL** = **3** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set linear acceleration properties.
  135. - **PARAM_RADIAL_ACCEL** = **4** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set radial acceleration properties.
  136. - **PARAM_TANGENTIAL_ACCEL** = **5** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set tangential acceleration properties.
  137. - **PARAM_DAMPING** = **6** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set damping properties.
  138. - **PARAM_ANGLE** = **7** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set angle properties.
  139. - **PARAM_SCALE** = **8** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set scale properties.
  140. - **PARAM_HUE_VARIATION** = **9** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set hue_variation properties.
  141. - **PARAM_ANIM_SPEED** = **10** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set animation speed properties.
  142. - **PARAM_ANIM_OFFSET** = **11** --- Use with :ref:`set_param<class_ParticlesMaterial_set_param>`, :ref:`set_param_randomness<class_ParticlesMaterial_set_param_randomness>`, and :ref:`set_param_texture<class_ParticlesMaterial_set_param_texture>` to set animation offset properties.
  143. - **PARAM_MAX** = **12**
  144. .. _enum_ParticlesMaterial_EmissionShape:
  145. enum **EmissionShape**
  146. - **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point.
  147. - **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere.
  148. - **EMISSION_SHAPE_BOX** = **2** --- Particles will be emitted in the volume of a box.
  149. - **EMISSION_SHAPE_POINTS** = **3**
  150. - **EMISSION_SHAPE_DIRECTED_POINTS** = **4**
  151. Description
  152. -----------
  153. ParticlesMaterial defines particle properties and behavior. It is used in the ``process_material`` of :ref:`Particles<class_particles>` and :ref:`Particles2D<class_particles2d>` emitter nodes.
  154. Some of this material's properties are applied to each particle when emitted, while others can have a :ref:`CurveTexture<class_curvetexture>` applied to vary values over the lifetime of the particle.