Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

ProjectileData

ProjectileData derives from GameBaseData and is used to provide rendering, behavior, and physics data for Projectile objects.

The table below details the fields in ProjectileData. For the sake of space and clarity we will continue to omit the two fields (category and className) which children of GameBaseData inherit.

Table D.11. ProjectileData Member Fields

Field NameTypeDefault ValueDescription
Special Effects Data
particleEmitterParticleEmitterDataPtrNULLPoints to the ParticleEmitter datablock used to generate particles for the projectile when it is out of water, and when entering or leaving water. Must adhere to the semantics associated with the ParticleEmitterDataPtr datatype, as defined in the engine.
particleWaterEmitterParticleEmitterDataPtrNULLPoints to the ParticleEmitter datablock used to generate particles for the projectile when it is under water, and when it is entering or leaving water. Both the basic particleEmitter and that particleWaterEmitter are used to generate particles when the Projectile object is coming out of or entering water. Must adhere to the semantics associated with the ParticleEmitterDataPtr datatype, as defined in the engine.
explosionExplosionDataPtrNULLPoints to the ExplosionData datablock used when the Projectile object blows up out of water. Must adhere to the semantics associated with the ExplosionDataPtr datatype, as defined in the engine.
waterExplosionExplosionDataPtrNULLPoints to the ExplosionData datablock used when the Projectile object blows up in the water. Must adhere to the semantics associated with the ExplosionDataPtr datatype, as defined in the engine.
soundAudioProfilePtrNULLPoints to the AudioProfile used to generate the Projectile object's sound. Must adhere to the semantics associated with the AudioProfilePtr datatype, as defined in the engine.
splashSplashDataPtrNULLPoints to the SplashData datablock used in the generation of splash effects when the Projectile is entering or leaving water. Must adhere to the semantics associated with the SplashDataPtr datatype, as defined in the engine.
decalDecalDataPtr (array)NULL [NumDecals]Array of pointers to DecalData datablocks. A non-NULL decal object will be randomly chosen from the array when the Projectile collides with the terrain or an interior. Values in the array must adhere to the semantics associated with the DecalDataPtr datatype, as defined in the engine.
Rendering Data
projectileShapeNameFilenameNULLThe name of the shape file for the Projectile object. Must adhere to the semantics associated with the Filename datatype as defined in the engine.
hasLightBooleanFalseSpecifies whether the Projectile object sheds light when not in water. If so, a point light object is used with the radius and color specified in the lightRadius and lightColor fields.
hasWaterLightBooleanFalseSpecifies whether the Projectile object sheds light when in water. If so, a point light object is used with the radius and color specified in the lightRadius and waterLightColor fields.
lightRadiusFloat1.0The projectile's point light radius. Valid range is 1.0 to 20.0
lightColorColorF(1.0, 1.0, 1.0)The projectile's point light color for use when not in water.
waterLightColorColorF(1.0, 1.0, 1.0)The projectile's point light color for use when in water.
ScalePoint3F(1.0, 1.0, 1.0)The rendering scale transformations to be applied along the shape's x-, y-, and z- axes, respectively.
Behavior Data
lifetimeInteger62The number of ticks the Projectile should survive for. Also used along with fadeDelay to determine the transparency of the Projectile object at a given time. See the fadeDelay field documentation for more information. The valid range for lifetime values is 0 to Projectile::MaxLivingTicks (4095 by default).
armingDelayInteger0The number of ticks that must pass after the Projectile is created before it can explode. Valid range is 0 to Projectile::MaxLivingTicks (4095 by default).
fadeDelayInteger62The number of ticks that must pass after the Projectile is created before it will begin becoming transparent. Projectile's opacity will follow a linear degression starting fadeDelay number of ticks after it is creating and ending at lifetime number of ticks. Valid range is 0 to Projectile::MaxLivingTicks (4095 by default).
Physics Data
isBallisticBooleanFalseSpecifies whether the Projectile will be affected by gravity, and whether it can bounce before exploding.
velInheritFactorFloat1.0Note: this field currently has no tangible effect in the engine simulation itself, but it is useful in script, and its valid range is checked by the engine. Valid range is from 0.0 to 1.0.
muzzleVelocityFloat50.0Note: this field currently has no tangible effect in the engine simulation itself, but it is useful in script, and its valid range is checked by the engine. Valid range is from 0.0 to 10,000.0
bounceElasticityFloat0.999Used to simulate the Projectile's bounce elasticity, if it collides with something but does not explode. The bounce elasticity scales the velocity from a bounce, after friction is taken into account. Valid range is from 0.0 to 0.999.
gravityModFloat1.0If isBallistic is true, scales the effect of gravity on the Projectile. Valid range is 0.0 to 1.0.

In the next section we examine DebrisData, which also dervies from GameBaseData.