< 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 ()
  2. gh_ps.create ()
  3. gh_ps.create_action_gravity ()
  4. gh_ps.create_emitter_point ()
  5. gh_ps.emitter_set_particle_rate_and_speed ()
  6. gh_ps.emitter_set_spawn_directions ()
  7. gh_ps.get_num_alive_particles ()
  8. gh_ps.process_particle_actions ()
  9. gh_ps.process_particle_emitters ()
  10. gh_ps.process_particles ()
  11. gh_ps.update_particles_lifetime ()



action_set_gravity

Description

Sets the gravity vector of an gravity action.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


create

Description

Creates a particle system.


Syntax

ps_id = gh_ps.create(
 max_particles,
 lifetime
)

Languages


Parameters


Return Values


Code sample


ps_id = 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


Parameters


Return Values


Code sample


action_id = 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


Parameters


Return Values


Code sample


emitter_id = 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


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_ps.emitter_set_spawn_directions(emitter_id, -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

num_alive = gh_ps.get_num_alive_particles(
 ps_id
)

Languages


Parameters


Return Values


Code sample


n = gh_ps.get_num_alive_particles(ps_id)
			


process_particle_actions

Description

Processes all particles actions.


Syntax

gh_ps.process_particle_actions(
 ps_id,
 dt
)

Languages


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_ps.process_particle_emitters(ps_id, 0.016)
			


process_particles

Description

Processes all particles (run simulation).


Syntax

gh_ps.process_particles(
 ps_id,
 dt
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_ps.process_particles(ps_id, 0.016)
			


update_particles_lifetime

Description

Updates the particles life time.


Syntax

gh_ps.update_particles_lifetime(
 ps_id,
 dt
)

Languages


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