Skip to content
reduz edited this page Apr 10, 2014 · 10 revisions

Particles

####Inherits: GeometryInstance ####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

  • void set_amount ( int amount )

Set total amount of particles in the system.

  • int get_amount ( ) const

Return the total amount of particles in the system.

  • void set_emitting ( bool enabled )

Set the "emitting" property state. When emitting, the particle system generates new particles at constant rate.

  • bool is_emitting ( ) const

Return the "emitting" property state (see set_emitting).

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

  • AABB get_visibility_aabb ( ) const

Return the current visibility AABB.

  • void set_emission_half_extents ( Vector3 half_extents )

Set the half extents for the emission box.

  • Vector3 get_emission_half_extents ( ) const

Return the half extents for the emission box.

  • void set_gravity_normal ( Vector3 normal )

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

  • Vector3 get_gravity_normal ( ) const

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

  • void set_variable ( int variable, float value )

Set a specific variable for the particle system (see VAR_* enum).

  • float get_variable ( int variable ) const

Return a specific variable for the particle system (see VAR_* enum).

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

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

  • void set_color_phase_pos ( int phase, float pos )

Set the position of a color phase (0 to 1)

  • float get_color_phase_pos ( int phase ) const

Return the position of a color phase (0 to 1)

  • void set_color_phase_color ( int phase, Color color )

Set the color of a color phase.

  • Color get_color_phase_color ( int phase ) const

Return the color of a color phase.

  • void set_material ( Material material )

Set the material used to draw particles

Return the material used to draw particles

Clone this wiki locally