123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
- .. _class_Particles:
- Particles
- =========
- **Inherits:** :ref:`GeometryInstance<class_geometryinstance>` **<** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- Particle system 3D Node
- Member Functions
- ----------------
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_amount<class_Particles_get_amount>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_color>` | :ref:`get_color_phase_color<class_Particles_get_color_phase_color>` **(** :ref:`int<class_int>` phase **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_color_phase_pos<class_Particles_get_color_phase_pos>` **(** :ref:`int<class_int>` phase **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_color_phases<class_Particles_get_color_phases>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_vector3>` | :ref:`get_emission_base_velocity<class_Particles_get_emission_base_velocity>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_vector3>` | :ref:`get_emission_half_extents<class_Particles_get_emission_half_extents>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3Array<class_vector3array>` | :ref:`get_emission_points<class_Particles_get_emission_points>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_emit_timeout<class_Particles_get_emit_timeout>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector3<class_vector3>` | :ref:`get_gravity_normal<class_Particles_get_gravity_normal>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Material<class_material>` | :ref:`get_material<class_Particles_get_material>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_randomness<class_Particles_get_randomness>` **(** :ref:`int<class_int>` variable **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_variable<class_Particles_get_variable>` **(** :ref:`int<class_int>` variable **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`AABB<class_aabb>` | :ref:`get_visibility_aabb<class_Particles_get_visibility_aabb>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_height_from_velocity<class_Particles_has_height_from_velocity>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_emitting<class_Particles_is_emitting>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_using_local_coordinates<class_Particles_is_using_local_coordinates>` **(** **)** const |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_amount<class_Particles_set_amount>` **(** :ref:`int<class_int>` amount **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_color_phase_color<class_Particles_set_color_phase_color>` **(** :ref:`int<class_int>` phase, :ref:`Color<class_color>` color **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_color_phase_pos<class_Particles_set_color_phase_pos>` **(** :ref:`int<class_int>` phase, :ref:`float<class_float>` pos **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_color_phases<class_Particles_set_color_phases>` **(** :ref:`int<class_int>` count **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_emission_base_velocity<class_Particles_set_emission_base_velocity>` **(** :ref:`Vector3<class_vector3>` base_velocity **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_emission_half_extents<class_Particles_set_emission_half_extents>` **(** :ref:`Vector3<class_vector3>` half_extents **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_emission_points<class_Particles_set_emission_points>` **(** :ref:`Vector3Array<class_vector3array>` points **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_emit_timeout<class_Particles_set_emit_timeout>` **(** :ref:`float<class_float>` timeout **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_emitting<class_Particles_set_emitting>` **(** :ref:`bool<class_bool>` enabled **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_gravity_normal<class_Particles_set_gravity_normal>` **(** :ref:`Vector3<class_vector3>` normal **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_height_from_velocity<class_Particles_set_height_from_velocity>` **(** :ref:`bool<class_bool>` enable **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_material<class_Particles_set_material>` **(** :ref:`Material<class_material>` material **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_randomness<class_Particles_set_randomness>` **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` randomness **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_use_local_coordinates<class_Particles_set_use_local_coordinates>` **(** :ref:`bool<class_bool>` enable **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_variable<class_Particles_set_variable>` **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` value **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_visibility_aabb<class_Particles_set_visibility_aabb>` **(** :ref:`AABB<class_aabb>` aabb **)** |
- +------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
- Numeric Constants
- -----------------
- - **VAR_LIFETIME** = **0**
- - **VAR_SPREAD** = **1**
- - **VAR_GRAVITY** = **2**
- - **VAR_LINEAR_VELOCITY** = **3**
- - **VAR_ANGULAR_VELOCITY** = **4**
- - **VAR_LINEAR_ACCELERATION** = **5**
- - **VAR_DRAG** = **6**
- - **VAR_TANGENTIAL_ACCELERATION** = **7**
- - **VAR_INITIAL_SIZE** = **9**
- - **VAR_FINAL_SIZE** = **10**
- - **VAR_INITIAL_ANGLE** = **11**
- - **VAR_HEIGHT** = **12**
- - **VAR_HEIGHT_SPEED_SCALE** = **13**
- - **VAR_MAX** = **14**
- Description
- -----------
- Particles is a particle system 3D :ref:`Node<class_node>` that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist).
- Member Function Description
- ---------------------------
- .. _class_Particles_get_amount:
- - :ref:`int<class_int>` **get_amount** **(** **)** const
- Return the total amount of particles in the system.
- .. _class_Particles_get_color_phase_color:
- - :ref:`Color<class_color>` **get_color_phase_color** **(** :ref:`int<class_int>` phase **)** const
- Return the color of a color phase.
- .. _class_Particles_get_color_phase_pos:
- - :ref:`float<class_float>` **get_color_phase_pos** **(** :ref:`int<class_int>` phase **)** const
- Return the position of a color phase (0 to 1).
- .. _class_Particles_get_color_phases:
- - :ref:`int<class_int>` **get_color_phases** **(** **)** const
- .. _class_Particles_get_emission_base_velocity:
- - :ref:`Vector3<class_vector3>` **get_emission_base_velocity** **(** **)** const
- .. _class_Particles_get_emission_half_extents:
- - :ref:`Vector3<class_vector3>` **get_emission_half_extents** **(** **)** const
- Return the half extents for the emission box.
- .. _class_Particles_get_emission_points:
- - :ref:`Vector3Array<class_vector3array>` **get_emission_points** **(** **)** const
- .. _class_Particles_get_emit_timeout:
- - :ref:`float<class_float>` **get_emit_timeout** **(** **)** const
- .. _class_Particles_get_gravity_normal:
- - :ref:`Vector3<class_vector3>` **get_gravity_normal** **(** **)** const
- Return the normal vector towards where gravity is pulling (by default, negative Y).
- .. _class_Particles_get_material:
- - :ref:`Material<class_material>` **get_material** **(** **)** const
- Return the material used to draw particles.
- .. _class_Particles_get_randomness:
- - :ref:`float<class_float>` **get_randomness** **(** :ref:`int<class_int>` variable **)** const
- Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
- .. _class_Particles_get_variable:
- - :ref:`float<class_float>` **get_variable** **(** :ref:`int<class_int>` variable **)** const
- Return a specific variable for the particle system (see VAR\_\* enum).
- .. _class_Particles_get_visibility_aabb:
- - :ref:`AABB<class_aabb>` **get_visibility_aabb** **(** **)** const
- Return the current visibility AABB.
- .. _class_Particles_has_height_from_velocity:
- - :ref:`bool<class_bool>` **has_height_from_velocity** **(** **)** const
- .. _class_Particles_is_emitting:
- - :ref:`bool<class_bool>` **is_emitting** **(** **)** const
- Return the "emitting" property state (see :ref:`set_emitting<class_Particles_set_emitting>`).
- .. _class_Particles_is_using_local_coordinates:
- - :ref:`bool<class_bool>` **is_using_local_coordinates** **(** **)** const
- .. _class_Particles_set_amount:
- - void **set_amount** **(** :ref:`int<class_int>` amount **)**
- Set total amount of particles in the system.
- .. _class_Particles_set_color_phase_color:
- - void **set_color_phase_color** **(** :ref:`int<class_int>` phase, :ref:`Color<class_color>` color **)**
- Set the color of a color phase.
- .. _class_Particles_set_color_phase_pos:
- - void **set_color_phase_pos** **(** :ref:`int<class_int>` phase, :ref:`float<class_float>` pos **)**
- Set the position of a color phase (0 to 1).
- .. _class_Particles_set_color_phases:
- - void **set_color_phases** **(** :ref:`int<class_int>` count **)**
- .. _class_Particles_set_emission_base_velocity:
- - void **set_emission_base_velocity** **(** :ref:`Vector3<class_vector3>` base_velocity **)**
- .. _class_Particles_set_emission_half_extents:
- - void **set_emission_half_extents** **(** :ref:`Vector3<class_vector3>` half_extents **)**
- Set the half extents for the emission box.
- .. _class_Particles_set_emission_points:
- - void **set_emission_points** **(** :ref:`Vector3Array<class_vector3array>` points **)**
- .. _class_Particles_set_emit_timeout:
- - void **set_emit_timeout** **(** :ref:`float<class_float>` timeout **)**
- .. _class_Particles_set_emitting:
- - void **set_emitting** **(** :ref:`bool<class_bool>` enabled **)**
- Set the "emitting" property state. When emitting, the particle system generates new particles at constant rate.
- .. _class_Particles_set_gravity_normal:
- - void **set_gravity_normal** **(** :ref:`Vector3<class_vector3>` normal **)**
- Set the normal vector towards where gravity is pulling (by default, negative Y).
- .. _class_Particles_set_height_from_velocity:
- - void **set_height_from_velocity** **(** :ref:`bool<class_bool>` enable **)**
- .. _class_Particles_set_material:
- - void **set_material** **(** :ref:`Material<class_material>` material **)**
- Set the material used to draw particles.
- .. _class_Particles_set_randomness:
- - void **set_randomness** **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` randomness **)**
- Set the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
- .. _class_Particles_set_use_local_coordinates:
- - void **set_use_local_coordinates** **(** :ref:`bool<class_bool>` enable **)**
- .. _class_Particles_set_variable:
- - void **set_variable** **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` value **)**
- Set a specific variable for the particle system (see VAR\_\* enum).
- .. _class_Particles_set_visibility_aabb:
- - void **set_visibility_aabb** **(** :ref:`AABB<class_aabb>` aabb **)**
- Set the visibility AABB for the particle system, since the default one will not work properly most of the time.
|