Torque 3D - Script Manual: ParticleData Class Reference

TorqueScript

Main   Class List   Namespace List   Online

ParticleData Class Reference
[Special Effects]

Contains information for how specific particles should look and react including particle colors, particle imagemap, acceleration value for individual particles and spin information. More...

Inheritance diagram for ParticleData:

List of all members.

Public Member Functions

void reload ()
 Reloads this particle.

Public Attributes

bool animateTexture
 If true, allow the particle texture to be an animated sprite.
string animTexFrames
 A list of frames and/or frame ranges to use for particle animation if animateTexture is true.
string animTexName
 Texture file to use for this particle if animateTexture is true.
Point2I animTexTiling
 The number of frames, in rows and columns stored in textureName (when animateTexture is true).
ColorF colors [4]
 Particle RGBA color keyframe values.
float constantAcceleration
 Constant acceleration to apply to this particle.
float dragCoefficient
 Particle physics drag amount.
int framesPerSec
 If animateTexture is true, this defines the frames per second of the sprite animation.
float gravityCoefficient
 Strength of gravity on the particles.
float inheritedVelFactor
 Amount of emitter velocity to add to particle initial velocity.
int lifetimeMS
 Time in milliseconds before this particle is destroyed.
int lifetimeVarianceMS
 Variance in lifetime of particle, from 0 - lifetimeMS.
float sizes [4]
 Particle size keyframe values.
float spinRandomMax
 Maximum allowed spin speed of this particle, between spinRandomMin and 10000.
float spinRandomMin
 Minimum allowed spin speed of this particle, between -10000 and spinRandomMax.
float spinSpeed
 Speed at which to spin the particle.
Point2F textureCoords [4]
 4 element array defining the UV coords into textureName to use for this particle.
string textureName
 Texture file to use for this particle.
float times [4]
 Time keys used with the colors and sizes keyframes.
bool useInvAlpha
 Controls how particles blend with the scene.
float windCoefficient
 Strength of wind on the particles.

Detailed Description

Contains information for how specific particles should look and react including particle colors, particle imagemap, acceleration value for individual particles and spin information.

Example:
datablock ParticleData( GLWaterExpSmoke )
{
   textureName = "art/shapes/particles/smoke";
   dragCoefficient = 0.4;
   gravityCoefficient = -0.25;
   inheritedVelFactor = 0.025;
   constantAcceleration = -1.1;
   lifetimeMS = 1250;
   lifetimeVarianceMS = 0;
   useInvAlpha = false;
   spinSpeed = 1;
   spinRandomMin = -200.0;
   spinRandomMax = 200.0;

   colors[0] = "0.1 0.1 1.0 1.0";
   colors[1] = "0.4 0.4 1.0 1.0";
   colors[2] = "0.4 0.4 1.0 0.0";

   sizes[0] = 2.0;
   sizes[1] = 6.0;
   sizes[2] = 2.0;

   times[0] = 0.0;
   times[1] = 0.5;
   times[2] = 1.0;
};
See also:
ParticleEmitter
ParticleEmitterData
ParticleEmitterNode

Member Function Documentation

void ParticleData::reload (  ) 

Reloads this particle.

Example:
// Get the editor's current particle
%particle = PE_ParticleEditor.currParticle

// Change a particle value
%particle.setFieldValue( %propertyField, %value );

// Reload it
%particle.reload();

Member Data Documentation

If true, allow the particle texture to be an animated sprite.

A list of frames and/or frame ranges to use for particle animation if animateTexture is true.

Each frame token must be separated by whitespace. A frame token must be a positive integer frame number or a range of frame numbers separated with a '-'. The range separator, '-', cannot have any whitspace around it.

Ranges can be specified to move through the frames in reverse as well as forward (eg. 19-14). Frame numbers exceeding the number of tiles will wrap.

Example:
animTexFrames = "0-16 20 19 18 17 31-21";

Texture file to use for this particle if animateTexture is true.

Deprecated. Use textureName instead.

The number of frames, in rows and columns stored in textureName (when animateTexture is true).

A maximum of 256 frames can be stored in a single texture when using animTexTiling. Value should be "NumColumns NumRows", for example "4 4".

Particle RGBA color keyframe values.

The particle color will linearly interpolate between the color/time keys over the lifetime of the particle.

Constant acceleration to apply to this particle.

Particle physics drag amount.

If animateTexture is true, this defines the frames per second of the sprite animation.

Strength of gravity on the particles.

Amount of emitter velocity to add to particle initial velocity.

Time in milliseconds before this particle is destroyed.

Variance in lifetime of particle, from 0 - lifetimeMS.

Particle size keyframe values.

The particle size will linearly interpolate between the size/time keys over the lifetime of the particle.

Maximum allowed spin speed of this particle, between spinRandomMin and 10000.

Minimum allowed spin speed of this particle, between -10000 and spinRandomMax.

Speed at which to spin the particle.

4 element array defining the UV coords into textureName to use for this particle.

Coords should be set for the first tile only when using animTexTiling; coordinates for other tiles will be calculated automatically. "0 0" is top left and "1 1" is bottom right.

Texture file to use for this particle.

Time keys used with the colors and sizes keyframes.

Values are from 0.0 (particle creation) to 1.0 (end of lifespace).

Controls how particles blend with the scene.

If true, particles blend like ParticleBlendStyle NORMAL, if false, blend like ParticleBlendStyle ADDITIVE.

Note:
If ParticleEmitterData::blendStyle is set, it will override this value.

Strength of wind on the particles.



Copyright © GarageGames, LLC. All Rights Reserved.