Torque 3D - Script Manual: Special Effects

TorqueScript

Main   Class List   Namespace List   Online

Special Effects
[Game]

Classes responsible for special effect objects, such as Explosion, Debris, Particles, etc. More...

Classes

class  Debris
 Base debris class. Uses the DebrisData datablock for properties of individual debris objects. More...
class  DebrisData
 Stores properties for an individual debris type. More...
class  DecalData
 A datablock describing an individual decal. More...
class  DecalManager
 The object that manages all of the decals in the active mission. More...
class  Explosion
 The emitter for an explosion effect, with properties defined by a ExplosionData object. More...
class  ExplosionData
 Defines the attributes of an Explosion: particleEmitters, debris, lighting and camera shake effects. More...
class  ForestWindEmitter
 Object responsible for simulating wind in a level. More...
class  LightAnimData
 A datablock which defines and performs light animation, such as rotation, brightness fade, and colorization. More...
class  Lightning
 An emitter for lightning bolts. More...
class  LightningData
 Common data for a Lightning emitter object. More...
class  LightningStrikeEvent
 Network event that triggers a lightning strike on the client when it is received. More...
class  ParticleData
 Contains information for how specific particles should look and react including particle colors, particle imagemap, acceleration value for individual particles and spin information. More...
class  ParticleEmitter
 This object is responsible for spawning particles. More...
class  ParticleEmitterData
 Defines particle emission properties such as ejection angle, period and velocity for a ParticleEmitter. More...
class  ParticleEmitterNode
 A particle emitter object that can be positioned in the world and dynamically enabled or disabled. More...
class  ParticleEmitterNodeData
 Contains additional data to be associated with a ParticleEmitterNode. More...
class  Precipitation
 Defines a precipitation based storm (rain, snow, etc). More...
class  PrecipitationData
 Defines the droplets used in a storm (raindrops, snowflakes, etc). More...
class  Splash
 Manages the ring used for a Splash effect. More...
class  SplashData
 Acts as the physical point in space in white a Splash is created from. More...

Modules

 Decals
 

Decals are non-SimObject derived objects that are stored and loaded separately from the normal mission file.


Enumerations

enum  ParticleBlendStyle {
  NORMAL,
  ADDITIVE,
  SUBTRACTIVE,
  PREMULTALPHA
}
 

The type of visual blending style to apply to the particles.

More...

Functions

float calcExplosionCoverage (Point3F pos=Point3F(0.0f, 0.0f, 0.0f), int id=NULL, int covMask=NULL)
 Calculates how much an explosion effects a specific object.

Detailed Description

Classes responsible for special effect objects, such as Explosion, Debris, Particles, etc.


Enumeration Type Documentation

The type of visual blending style to apply to the particles.

Enumerator:
NORMAL 

No blending style.

ADDITIVE 

Adds the color of the pixel to the frame buffer with full alpha for each pixel.

SUBTRACTIVE 

Subtractive Blending. Reverses the color model, causing dark colors to have a stronger visual effect.

PREMULTALPHA 

Color blends with the colors of the imagemap rather than the alpha.


Function Documentation

float calcExplosionCoverage ( Point3F  pos = Point3F(0.0f, 0.0f, 0.0f),
int  id = NULL,
int  covMask = NULL 
)

Calculates how much an explosion effects a specific object.

Use this to determine how much damage to apply to objects based on their distance from the explosion's center point, and whether the explosion is blocked by other objects.

Parameters:
pos Center position of the explosion.
id Id of the object of which to check coverage.
covMask Mask of object types that may block the explosion.
Returns:
Coverage value from 0 (not affected by the explosion) to 1 (fully affected)
Example:
// Get the position of the explosion.
%position = %explosion.getPosition();

// Set a list of TypeMasks (defined in gameFunctioncs.cpp), seperated by the | character.
%TypeMasks = $TypeMasks::StaticObjectType | $TypeMasks::ItemObjectType

// Acquire the damage value from 0.0f - 1.0f.
%coverage = calcExplosionCoverage( %position, %sceneObject, %TypeMasks );

// Apply damage to object
%sceneObject.applyDamage( %coverage * 20 );


Copyright © GarageGames, LLC. All Rights Reserved.