Function _IrrAddParticleSystemToScene

au3Irr2

au3Irr2 Function Reference

_IrrAddParticleSystemToScene

Adds a particle system to the irrlicht scene manager.

#Include <au3Irrlicht2.au3>
_IrrAddParticleSystemToScene($b_AddEmitter, $h_Parent = 0, $i_Id = -1, $f_PosX = 0, $f_PosY = 0, $f_PosZ = 0, $f_RotX = 0, $f_RotY = 0, $f_RotZ = 0, $f_ScaleX = 1, $f_ScaleY = 1, $f_ScaleZ = 1)

 

Parameters

$b_AddEmitter Whether default emitter shall be created or not:
$IRR_NO_EMITTER - For no default emitter (this is probably the option you will use and you will then add a specific emitter later).
IRR_DEFAULT_EMITTER - To create a default emitter that ejects a thin vertical stream of particles.
$h_Parent [optional] Handle of scene node the particle shall be attached to (0 means attach to the root scene node)
$i_Id [optional] Assigns given integer as ID to the created particle system.
$f_PosX, $f_PosY, $f_PosZ [optional] Set position of particle system in the Irrlicht scene.
$f_RotX, $f_RotY, $f_RotZ [optional] Rotate the particle system along x, y, z axes (0-360).
$f_ScaleX, $f_ScaleY, $f_ScaleZ [optional] Scaling factors for created particle system.

 

Return Value

success: Handle of the created particle system.
failure: False

 

Remarks

A particle system is an object that creates and manages hundreds of small billboard like objects that are used to represent smoke, rain and other natural effects.
Once created you then need to add emitters and affectors to create and control the particles.

 

Related

_IrrAddParticleEmitter, _IrrAddFadeOutParticleAffector, _IrrAddGravityParticleAffector, _IrrAddParticleAttractionAffector, _IrrAddRotationAffector

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

; add particle system with default emitter to the irrlicht scene manager and scale it for more depth
local $particleSystem = _IrrAddParticleSystemToScene($IRR_DEFAULT_EMITTER, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 6)
; load a grey smoke like image for the particle
local $ParticleTexture = _IrrGetTexture( "./media/ParticleGrey.bmp" )

; apply the texture to the particles system to be drawn across each particles surface
_IrrSetNodeMaterialTexture( $particleSystem, $ParticleTexture, 0 )
; particle system is not affected by lighting so make it self illuminating
_IrrSetNodeMaterialFlag( $particleSystem, $IRR_EMF_LIGHTING, $IRR_OFF )
; don't draw black parts of the particle texture:
_IrrSetNodeMaterialType ( $particleSystem, $IRR_EMT_TRANSPARENT_ADD_COLOR )

local $nodeCamera = _IrrAddCamera( 80,0,0, 20,40,0 )

WHILE _IrrRunning()
    _IrrBeginScene( 0,0,50 )
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()