Function _IrrAddParticleAttractionAffector

au3Irr2

au3Irr2 Function Reference

_IrrAddParticleAttractionAffector

Adds an affector to a particle system attracting particles to a specified point at a specified speed.

#Include <au3Irrlicht2.au3>
_IrrAddParticleAttractionAffector($h_ParticleSystem, $f_X, $f_Y, $f_Z, $f_Speed = 1, $i_Attract = $IRR_ATTRACT, $b_AffectX = true, $b_AffectY = true, $b_AffectZ = true)

 

Parameters

$h_ParticleSystem Handle of the particle system the created affector is attached to.
$f_X, $f_Y, $f_Z Set the point that particles will attract to.
$f_Speed [optional] Speed in units per second, to attract to the specified point.
$i_Attract [optional] Set whether or not the particles are attracting or detracting. Values are:
$IRR_ATTRACT - particles are attracting.
IRR_REPEL - particles are detracting.
$b_AffectX, $b_AffectY, $b_AffectZ [optional] Set whether or not this will affect particles in the X, Y, Z direction.

 

Return Value

success: Handle of the created affector.
failure: false

 

Remarks

None.

 

Related

_IrrAddParticleSystemToScene, _IrrSetParticleAffectorEnable, _IrrRemoveAffectors

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

; add particle system with default emitter to the irrlicht scene manager
local $particleSystem = _IrrAddParticleSystemToScene($IRR_DEFAULT_EMITTER)
local $ParticleTexture = _IrrGetTexture( "./media/ParticleGrey.bmp" )

; setup this affector to detract particles downwards
_IrrAddParticleAttractionAffector ( $particleSystem, 0,100.0,0.0, 80.0, $IRR_REPEL )

_IrrSetNodeMaterialTexture( $particleSystem, $ParticleTexture, 0 )
_IrrSetNodeMaterialFlag( $particleSystem, $IRR_EMF_LIGHTING, $IRR_OFF )
_IrrSetNodeMaterialType ( $particleSystem, $IRR_EMT_TRANSPARENT_ADD_COLOR )

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

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

_IrrStop()