Particles¶
Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object
Category: Core
Brief Description¶
Particle system 3D Node
Member Functions¶
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 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¶
int get_amount ( ) const
Return the total amount of particles in the system.
Return the color of a color phase.
Return the position of a color phase (0 to 1).
int get_color_phases ( ) const
Vector3 get_emission_base_velocity ( ) const
Vector3 get_emission_half_extents ( ) const
Return the half extents for the emission box.
Vector3Array get_emission_points ( ) const
float get_emit_timeout ( ) const
Vector3 get_gravity_normal ( ) const
Return the normal vector towards where gravity is pulling (by default, negative Y).
Material get_material ( ) const
Return the material used to draw particles.
Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
Return a specific variable for the particle system (see VAR_* enum).
AABB get_visibility_aabb ( ) const
Return the current visibility AABB.
bool has_height_from_velocity ( ) const
bool is_emitting ( ) const
Return the “emitting” property state (see set_emitting).
bool is_using_local_coordinates ( ) const
void set_amount ( int amount )
Set total amount of particles in the system.
Set the color of a color phase.
Set the position of a color phase (0 to 1).
void set_color_phases ( int count )
void set_emission_base_velocity ( Vector3 base_velocity )
void set_emission_half_extents ( Vector3 half_extents )
Set the half extents for the emission box.
void set_emission_points ( Vector3Array points )
void set_emit_timeout ( float timeout )
void set_emitting ( bool enabled )
Set the “emitting” property state. When emitting, the particle system generates new particles at constant rate.
void set_gravity_normal ( Vector3 normal )
Set the normal vector towards where gravity is pulling (by default, negative Y).
void set_height_from_velocity ( bool enable )
void set_material ( Material material )
Set the material used to draw particles.
Set the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted.
void set_use_local_coordinates ( bool enable )
Set a specific variable for the particle system (see VAR_* enum).
void set_visibility_aabb ( AABB aabb )
Set the visibility AABB for the particle system, since the default one will not work properly most of the time.