» Back To Index
Demoniak3D/LUA API: Particles systems Management library
The
HYP_ParticleSystem library allows to apply settings on the various particles systems created in the XML script.
HYP_ParticleSystem.DisableEmitterEmission
HYP_ParticleSystem.SetEmitterSpawnVecMax
HYP_ParticleSystem.SetEmitterSpawnVecMin
HYP_ParticleSystem.Disable
HYP_ParticleSystem.EnableEmitterEmission
HYP_ParticleSystem.Enable
HYP_ParticleSystem.SetEmitterMasterObject
SetEmitterSpawnVecMax
SetEmitterSpawnVecMax allows to specify the maximum value of the vector which controls the emission cone of the particles.
This function is usable with a POINT or LINE type emitter.
Syntax
HYP_ParticleSystem.SetEmitterSpawnVecMax( emitter_name, spawn_x, spawn_y, spawn_z );
- emitter_name - [STR127] - name of the particles emitter as specified in the XML script by the "name" attribute.
- spawn_x - [REAL] - X coordinate of the spawn vector.
- spawn_y - [REAL] - Y coordinate of the spawn vector.
- spawn_z - [REAL] - Z coordinate of the spawn vector.
Example
...
-- Emission cone centered in Y.
HYP_ParticleSystem.SetEmitterSpawnVecMax( "pointEmitter", 0.2, 1.0, 0.2 );
HYP_ParticleSystem.SetEmitterSpawnVecMin( "pointEmitter", -0.2, 0.2, -0.2 );
...
SetEmitterSpawnVecMin
SetEmitterSpawnVecMin allows to specify the minimal value of the vector which controls the emission cone of the particles.
This function is usable with a POINT or LINE type emitter.
Syntax
HYP_ParticleSystem.SetEmitterSpawnVecMin( emitter_name, spawn_x, spawn_y, spawn_z );
- emitter_name - [STR127] - name of the particles emitter as specified in the XML script by the "name" attribute.
- spawn_x - [REAL] - X coordinate of the spawn vector.
- spawn_y - [REAL] - Y coordinate of the spawn vector.
- spawn_z - [REAL] - Z coordinate of the spawn vector.
Example
...
-- Emission cone centered in Y.
HYP_ParticleSystem.SetEmitterSpawnVecMaxs( "pointEmitter", 0.2, 1.0, 0.2 );
HYP_ParticleSystem.SetEmitterSpawnVecMin( "pointEmitter", -0.2, 0.2, -0.2 );
...
Enable
Enable allows to activate the particles system passed as parameter.
Syntax
HYP_ParticleSystem.Enable( name );
- name - [STR127] - name of the particles system as specified in the XML script by the name attribute.
Disable
HYP_Disable will disable the particles system passed as parameter.
Syntax
HYP_ParticleSystem.Disable( name );
- name - [STR127] - name of the particles system as specified in the XML script by the name attribute.
Remark
The desactivation of a particles system involves the instantaneous disappearance of all the
particles displayed on the screen.
Refer to the DisableEmitterEmission function to stop new particles creation without making disappear
the particles that have been already created.
EnableEmitterEmission
EnableEmitterEmission allows to activate the creation of new particles for a given emitter.
Syntax
HYP_ParticleSystem.EnableEmitterEmission( name );
- name - [STR127] - name of the particles emitter as specified in the XML script by the "name" attribute.
DisableEmitterEmission
DisableEmitterEmission allows to stop the creation of new particles without making disappear the particles that have been already created.
Syntax
HYP_ParticleSystem.DisableEmitterEmission( name );
- name - [STR127] - name of the particles emitter as specified in the XML script by the "name" attribute.
SetEmitterMasterObject
SetEmitterMasterObject allows to specify the main object for a particles emitter.
The main object is the object which allows to initialize the particles. It is mainly its shape which
is significant (point, disc, line, mesh).
Syntax
HYP_ParticleSystem.SetEmitterMasterObject( emitter_name, master_object_name );
- emitter_name - [STR127] - name of the particles emitter as specified in the XML script by the "name" attribute.
- master_object_name - [STR127] - name of the master object as specified in the XML script by the "name" attribute.