Particles

Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object

Category: Core

Brief Description

Particle system 3D Node

Member Functions

int get_amount ( ) const
Color get_color_phase_color ( int phase ) const
float get_color_phase_pos ( int phase ) const
int get_color_phases ( ) const
Vector3 get_emission_base_velocity ( ) const
Vector3 get_emission_half_extents ( ) const
Vector3Array get_emission_points ( ) const
float get_emit_timeout ( ) const
Vector3 get_gravity_normal ( ) const
Material get_material ( ) const
float get_randomness ( int variable ) const
float get_variable ( int variable ) const
AABB get_visibility_aabb ( ) const
bool has_height_from_velocity ( ) const
bool is_emitting ( ) const
bool is_using_local_coordinates ( ) const
void set_amount ( int amount )
void set_color_phase_color ( int phase, Color color )
void set_color_phase_pos ( int phase, float pos )
void set_color_phases ( int count )
void set_emission_base_velocity ( Vector3 base_velocity )
void set_emission_half_extents ( Vector3 half_extents )
void set_emission_points ( Vector3Array points )
void set_emit_timeout ( float timeout )
void set_emitting ( bool enabled )
void set_gravity_normal ( Vector3 normal )
void set_height_from_velocity ( bool enable )
void set_material ( Material material )
void set_randomness ( int variable, float randomness )
void set_use_local_coordinates ( bool enable )
void set_variable ( int variable, float value )
void set_visibility_aabb ( 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 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.

  • Color get_color_phase_color ( int phase ) const

Return the color of a color phase.

  • float get_color_phase_pos ( int phase ) const

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.

  • float get_emit_timeout ( ) const
  • Vector3 get_gravity_normal ( ) const

Return the normal vector towards where gravity is pulling (by default, negative Y).

Return the material used to draw particles.

  • float get_randomness ( 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.

  • float get_variable ( int variable ) const

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.

  • void set_color_phase_color ( int phase, Color color )

Set the color of a color phase.

  • void set_color_phase_pos ( int phase, float pos )

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_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.

  • void set_randomness ( int variable, 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.

  • void set_use_local_coordinates ( bool enable )
  • void set_variable ( int variable, float value )

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.