< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_ps library

Description

gh_ps is the module that manages particle systems.


Number of functions: 11

  1. gh_ps.action_set_gravity (Lua - Python)
  2. gh_ps.create (Lua - Python)
  3. gh_ps.create_action_gravity (Lua - Python)
  4. gh_ps.create_emitter_point (Lua - Python)
  5. gh_ps.emitter_set_particle_rate_and_speed (Lua - Python)
  6. gh_ps.emitter_set_spawn_directions (Lua - Python)
  7. gh_ps.get_num_alive_particles (Lua - Python)
  8. gh_ps.process_particles (Lua - Python)
  9. gh_ps.process_particle_actions (Lua - Python)
  10. gh_ps.process_particle_emitters (Lua - Python)
  11. gh_ps.update_particles_lifetime (Lua - Python)



action_set_gravity

Description

Sets the gravity vector of an gravity action.


Syntax

gh_ps.action_set_gravity(
 action_id,
 x, y, z
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.action_set_gravity(action_gravity, 0, -9.81, 0)
            


create

Description

Creates a particle system.


Syntax

ps_id = gh_ps.create(
 num_particles,
 lifetime
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
ps = gh_ps.create(1000, 2.0)
            


create_action_gravity

Description

Creates a gravity action.


Syntax

action_id = gh_ps.create_action_gravity(
 ps_id
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
action = gh_ps.create_action_gravity(ps_id)
            


create_emitter_point

Description

Creates a point emitter.


Syntax

emitter_id = gh_ps.create_emitter_point(
 ps_id
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
emitter = gh_ps.create_emitter_point(ps_id)
            


emitter_set_particle_rate_and_speed

Description

Sets the particle rate and the particle speed for a particular emitter.


Syntax

gh_ps.emitter_set_particle_rate_and_speed(
 emitter_id,
 rate, speed
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.emitter_set_particle_rate_and_speed(emitter_id, 100, 4.0)
            


emitter_set_spawn_directions

Description

Sets the particle spawn directions for a particular emitter.


Syntax

gh_ps.emitter_set_spawn_directions(
 emitter_id,
 x1, y1, z1,
 x2, y2, z2
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.emitter_set_spawn_directions(emitter_point, -0.1, 0.5, -0.1, 0.1, 1.0, 0.1)            
            


get_num_alive_particles

Description

Returns the number of alive particles (with lifetime > 0).


Syntax

n = gh_ps.get_num_alive_particles(
 ps_id
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
n = gh_ps.get_num_alive_particles(ps_id)
            


process_particles

Description

Processes all particles (run simulation).


Syntax

gh_ps.process_particles(
 ps_id,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.process_particles(ps_id, 0.016)
            


process_particle_actions

Description

Processes all particles actions.


Syntax

gh_ps.process_particle_actions(
 ps_id,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.process_particle_actions(ps_id, 0.016)
            


process_particle_emitters

Description

Processes all particles emitters.


Syntax

gh_ps.process_particle_emitters(
 ps_id,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.process_particle_emitters(ps_id, 0.016)
            


update_particles_lifetime

Description

Updates the particles life time.


Syntax

gh_ps.update_particles_lifetime(
 ps_id,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_ps.update_particles_lifetime(ps_id, 0.016)
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter