DebrisData

consoledoc.h

Stores properties for an individual debris type.

More...

Display

string

Texture imagemap to use for this debris object.

filename

Object model to use for this debris object.

Datablocks

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

ExplosionData to spawn along with this debris object.

Physical Properties

float

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

float

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

int

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

int

Allowed variance in the value of numBounces.

float

Minimum speed that this debris object will rotate.

float

Maximum speed that this debris object will rotate.

float

How much gravity affects debris.

float

Max velocity magnitude.

float

Speed at which this debris object will move.

float

Allowed variance in the value of velocity.

float

Amount of time until this debris object is destroyed.

float

Allowed variance in the value of lifetime.

bool

Use mass calculations based on radius.

float

Radius at which the standard elasticity and friction apply.

Behavior

bool

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

bool

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

bool

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

bool

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

bool

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

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.

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:

Display

string texture 

Texture imagemap to use for this debris object.

Not used any more.

filename shapeFile 

Object model to use for this debris object.

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

Datablocks

ParticleEmitterData emitters [2]

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

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

ExplosionData Explosion 

ExplosionData to spawn along with this debris object.

This is optional as not all Debris explode.

Physical Properties

float elasticity 

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

Must be in the range of -10 to 10.

float friction 

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

Must be in the range of -10 to 10.

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).

Must be within the range of 0 to 10000.

int bounceVariance 

Allowed variance in the value of numBounces.

Must be less than numBounces.

float minSpinSpeed 

Minimum speed that this debris object will rotate.

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

float maxSpinSpeed 

Maximum speed that this debris object will rotate.

Must be in the range of -10000 to 10000.

float gravModifier 

How much gravity affects debris.

float terminalVelocity 

Max velocity magnitude.

float velocity 

Speed at which this debris object will move.

float velocityVariance 

Allowed variance in the value of velocity.

Must be less than velocity.

float lifetime 

Amount of time until this debris object is destroyed.

Must be in the range of 0 to 1000.

float lifetimeVariance 

Allowed variance in the value of lifetime.

Must be less than lifetime.

bool useRadiusMass 

Use mass calculations based on radius.

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

float baseRadius 

Radius at which the standard elasticity and friction apply.

Only used when useRaduisMass is true.

Behavior

bool explodeOnMaxBounce 

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:

explosion

bool staticOnMaxBounce 

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

bool snapOnMaxBounce 

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

bool fade 

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

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

bool ignoreWater 

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