Torque 3D - Script Manual: ParticleEmitterNode Class Reference

TorqueScript

Main   Class List   Namespace List   Online

ParticleEmitterNode Class Reference
[Special Effects]

A particle emitter object that can be positioned in the world and dynamically enabled or disabled. More...

Inheritance diagram for ParticleEmitterNode:

List of all members.

Public Member Functions

void setActive (bool active)
 Turns the emitter on or off.
void setEmitterDataBlock (ParticleEmitterData emitterDatablock=0)
 Assigns the datablock for this emitter node.

Public Attributes

bool active
 Controls whether particles are emitted from this node.
ParticleEmitterData emitter
 Datablock to use when emitting particles.
float velocity
 Velocity to use when emitting particles (in the direction of the ParticleEmitterNode object's up (Z) axis).

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

A particle emitter object that can be positioned in the world and dynamically enabled or disabled.

Example:
datablock ParticleEmitterNodeData( SimpleEmitterNodeData )
{
   timeMultiple = 1.0;
};

%emitter = new ParticleEmitterNode()
{
   datablock = SimpleEmitterNodeData;
   active = true;
   emitter = FireEmitterData;
   velocity = 3.5;
};

// Dynamically change emitter datablock
%emitter.setEmitterDataBlock( DustEmitterData );
Note:
To change the emitter field dynamically (after the ParticleEmitterNode object has been created) you must use the setEmitterDataBlock() method or the change will not be replicated to other clients in the game. Similarly, use the setActive() method instead of changing the active field directly. When changing velocity, you need to toggle setActive() on and off to force the state change to be transmitted to other clients.
See also:
ParticleEmitterNodeData
ParticleEmitterData

Member Function Documentation

void ParticleEmitterNode::setActive ( bool  active  ) 

Turns the emitter on or off.

Parameters:
active New emitter state
void ParticleEmitterNode::setEmitterDataBlock ( ParticleEmitterData  emitterDatablock = 0  ) 

Assigns the datablock for this emitter node.

Parameters:
emitterDatablock ParticleEmitterData datablock to assign
Example:
// Assign a new emitter datablock
%emitter.setEmitterDatablock( %emitterDatablock );

Member Data Documentation

Controls whether particles are emitted from this node.

Datablock to use when emitting particles.

Velocity to use when emitting particles (in the direction of the ParticleEmitterNode object's up (Z) axis).



Copyright © GarageGames, LLC. All Rights Reserved.