Torque 3D - Script Manual: DebrisData Class Reference

TorqueScript

Main   Class List   Namespace List   Online

DebrisData Class Reference
[Special Effects]

Stores properties for an individual debris type. More...

Inheritance diagram for DebrisData:

List of all members.

Public Attributes

Physical Properties

float baseRadius
 Radius at which the standard elasticity and friction apply.
int bounceVariance
 Allowed variance in the value of numBounces.
float elasticity
 A floating-point value specifying how 'bouncy' this object is.
float friction
 A floating-point value specifying how much velocity is lost to impact and sliding friction.
float gravModifier
 How much gravity affects debris.
float lifetime
 Amount of time until this debris object is destroyed.
float lifetimeVariance
 Allowed variance in the value of lifetime.
float maxSpinSpeed
 Maximum speed that this debris object will rotate.
float minSpinSpeed
 Minimum speed that this debris object will rotate.
int numBounces
 How many times to allow this debris object to bounce until it either explodes, becomes static or snaps (defined in explodeOnMaxBounce, staticOnMaxBounce, snapOnMaxBounce).
float terminalVelocity
 Max velocity magnitude.
bool useRadiusMass
 Use mass calculations based on radius.
float velocity
 Speed at which this debris object will move.
float velocityVariance
 Allowed variance in the value of velocity.
Datablocks

ParticleEmitterData emitters [2]
 List of particle emitters to spawn along with this debris object.
ExplosionData Explosion
 ExplosionData to spawn along with this debris object.
Behavior

bool explodeOnMaxBounce
 If true, this debris object will explode after it has bounced max times.
bool fade
 If true, this debris object will fade out when destroyed.
bool ignoreWater
 If true, this debris object will not collide with water, acting as if the water is not there.
bool snapOnMaxBounce
 If true, this debris object will snap into a resting position on the last bounce.
bool staticOnMaxBounce
 If true, this debris object becomes static after it has bounced max times.
Display

filename shapeFile
 Object model to use for this debris object.
string texture
 Texture imagemap to use for this debris object.

Detailed Description

Stores properties for an individual debris type.

DebrisData defines the base properties for a Debris object. Typically you'll want a Debris object to consist of a shape and possibly up to two particle emitters. The DebrisData datablock provides the definition for these items, along with physical properties and how a Debris object will react to other game objects, such as water and terrain.

Example:
datablock DebrisData(GrenadeDebris)
{
   shapeFile = "art/shapes/weapons/ramrifle/debris.dts";
   emitters[0] = GrenadeDebrisFireEmitter;
   elasticity = 0.4;
   friction = 0.25;
   numBounces = 3;
   bounceVariance = 1;
   explodeOnMaxBounce = false;
   staticOnMaxBounce = false;
   snapOnMaxBounce = false;
   minSpinSpeed = 200;
   maxSpinSpeed = 600;
   lifetime = 4;
   lifetimeVariance = 1.5;
   velocity = 15;
   velocityVariance = 5;
   fade = true;
   useRadiusMass = true;
   baseRadius = 0.3;
   gravModifier = 1.0;
   terminalVelocity = 20;
   ignoreWater = false;
};
See also:
Debris

Member Data Documentation

Radius at which the standard elasticity and friction apply.

Only used when useRaduisMass is true.

See also:
useRadiusMass.

Allowed variance in the value of numBounces.

Must be less than numBounces.

See also:
numBounces

A floating-point value specifying how 'bouncy' this object is.

Must be in the range of -10 to 10.

List of particle emitters to spawn along with this debris object.

These are optional. You could have Debris made up of only a shape.

If true, this debris object will explode after it has bounced max times.

Be sure to provide an ExplosionData datablock for this to take effect.

See also:
explosion

ExplosionData to spawn along with this debris object.

This is optional as not all Debris explode.

If true, this debris object will fade out when destroyed.

This fade occurs over the last second of the Debris' lifetime.

A floating-point value specifying how much velocity is lost to impact and sliding friction.

Must be in the range of -10 to 10.

How much gravity affects debris.

If true, this debris object will not collide with water, acting as if the water is not there.

Amount of time until this debris object is destroyed.

Must be in the range of 0 to 1000.

See also:
lifetimeVariance

Allowed variance in the value of lifetime.

Must be less than lifetime.

See also:
lifetime

Maximum speed that this debris object will rotate.

Must be in the range of -10000 to 10000.

See also:
minSpinSpeed

Minimum speed that this debris object will rotate.

Must be in the range of -10000 to 1000, and must be less than maxSpinSpeed.

See also:
maxSpinSpeed

How many times to allow this debris object to bounce until it either explodes, becomes static or snaps (defined in explodeOnMaxBounce, staticOnMaxBounce, snapOnMaxBounce).

Must be within the range of 0 to 10000.

See also:
bounceVariance

Object model to use for this debris object.

This shape is optional. You could have Debris made up of only particles.

If true, this debris object will snap into a resting position on the last bounce.

If true, this debris object becomes static after it has bounced max times.

Max velocity magnitude.

Texture imagemap to use for this debris object.

Not used any more.

Use mass calculations based on radius.

Allows for the adjustment of elasticity and friction based on the Debris size.

See also:
baseRadius

Speed at which this debris object will move.

See also:
velocityVariance

Allowed variance in the value of velocity.

Must be less than velocity.

See also:
velocity


Copyright © GarageGames, LLC. All Rights Reserved.