Torque Game EngineTorque Game Engine Documentation
Version 1.3.x

VehicleData

VehicleData derives from ShapeBaseData and aids the creation of vehicle objects. Several other datablocks, such as WheeledVehicleData and FlyingVehicleData, derive from VehicleData. VehicleData defines many new fields, which are listed in the table below.

Table D.6. VehicleData Member Fields

Field NameTypeDefault ValueDescription
Special Effects Data
softImpactSoundAudioProfilePtrNULLThe AudioProfile used to produce sounds for soft impacts. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
hardImpactSoundAudioProfilePtrNULLThe AudioProfile used to produce sounds for hard impacts. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
splashFreqModFloat300.0The simulated frequency modulation of a splash generated by this vehicle. Multiplied along with vehicle speed and time elapsed when determining splash emition rate.
splashVelEpsilonFloat0.5The threshold speed at which we consider the vehicle's movement to have stopped when updating splash effects.
splashEmitterParticleEmitterDataPtr (array)NULL [VC_NUM_SPLASH_EMITTERS]Array of pointers to ParticleEmitterData datablocks which will generate splash effects. If specified, each pointer must reference a datablock of type ParticleEmitterData. Must adhere to the semantics associated with ParticleEmitterData*, as defined in the Torque Game Engine.
exitSplashSoundVelocityFloat2.0The minimum velocity at which the exit splash sound will be played when emerging from water.
softSplashSoundVelocityFloat1.0The minimum velocity at which the soft splash sound will be played when impacting water.
mediumSplashSoundVelocityFloat2.0The minimum velocity at which the medium splash sound will be played when impacting water.
hardSplashSoundVelocityFloat3.0The minimum velocity at which the hard splash sound will be played when impacting water.
exitingWaterAudioProfilePtrNULLThe AudioProfile will be used to produce sounds when emerging from water. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
impactWaterEasyAudioProfilePtrNULLThe AudioProfile will be used to produce sounds when a soft impact with water occurs. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
impactWaterMediumAudioProfilePtrNULLThe AudioProfile will be used to produce sounds when a medium impact with water occurs. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
impactWaterHardAudioProfilePtrNULLThe AudioProfile will be used to produce sounds when a hard impact with water occurs. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
waterWakeSoundAudioProfilePtrNULLThe AudioProfile will be used to produce sounds when a water wake is displayed. If specified, must point to an object of type AudioProfile. Must adhere to the semantics associated with AudioProfile*, as defined in the Torque Game Engine.
triggerDustHeightFloat3.0Maximum height from the ground at which the vehicle will generate dust.
dustHeightFloat1.0Height of dust effects.
dustEmitterParticleEmitterDataPtr (array)NULL [VC_NUM_DUST_EMITTERS]Array of pointers to ParticleEmitterData datablocks which will be used to emit particles at vehicle/terrain contact point. If specified, must point to a datablock of type ParticleEmitterData. Must adhere to the semantics associated with ParticleEmitterData*, as defined in the Torque Game Engine.
damageEmitterOffsetPoint3F (array)(uninitialized) [VC_NUM_DAMAGE_EMITTER_AREAS]Offset point at which to display damage effects. The number of array entries is limited by the VC_NUM_DAMAGEEMITTER_AREAS constant within the VehicleConsts enumeration as specified in the VehicleData class definition withing the Torque Game Engine.
numDmgEmitterAreasFloat0.0The number of areas on the vehicle that can display damage effects.
damageEmitterParticleEmitterDataPtr (array)NULL [VC_NUM_DAMAGE_EMITTERS]Array of pointers to ParticleEmitterData datablocks which will be used to emit particles for damage effects (smoke). If specified, the pointers must point to a datablock of type ParticleEmitterData. Must adhere to the semantics associated with ParticleEmitterData*, as defined in the Torque Game Engine.
Camera Data
cameraRollBooleanTrueSpecifies whether the camera's rotation matrix, and the render eye transform are multiplied during camera updates.
cameraLagFloat0.0Scalar amount by which the third person camera lags the vehicle, relative to the vehicle's linear velocity.
cameraDecayFloat0.0Scalar rate at which the third person camera offset decays, per tick.
cameraOffsetFloat0.0The vertical offset of the vehicle's camera.
Physics Data
integrationInteger1The number of discrete steps with which to process physics data per tick.
minImpactSpeedFloat25.0Minimum speed at which the vehicle must be travelling for the OnImpact script function to be called.
softImpactSpeedFloat25.0Minimum speed at which the vehicle must be travelling for the soft impact sound to be played.
hardImpactSpeedFloat50.0Minimum speed at which the vehicle must be travelling for the hard impact sound to be played.
massCenterPoint3F(0.0, 0.0, 0.0)The vehicle's rigid body center of mass.
bodyRestitutionFloat1.0The vehicle's rigid body restitution. Used in the physical simulation during collisions. The scalar restitution value affects the strength of the body's rebound resulting from collisions with objects. Higher restitution values yield more powerful rebound reactions.
bodyFrictionFloat0.0The vehicle's rigid body friction coefficient. Used in the physical simulation during contacts and collisions. Higher friction values dampen contact and collision forces.
contactTolFloat0.1The minimum collision velocity required to trigger a collision contact. Collisions with velocities less than the contactTol value will be treated as collision constraints.
collisionTolFloat0.1The minimum collision velocity required to trigger a full collision. Collisions with velocities less than the collisionTol value will be treated as collision contacts or constraints.
damageLevelToleranceFloat (array)0.0 [VC_NUM_DAMAGE_LEVELS]Array of floats specifying damage level thresholds. Each entry is specified as a decimal percentage of maxDamage (defined in ShapeBaseData). Each damage level is used to determine what damage effect to play.
maxSteeringAngleFloat0.785Maximum attainable steering angle, measured in radians. Steering angles are clamped to this maximum value.
minDragFloat0.0The minimum drag acting on the vehicle at all times. At present, this field is only used by FlyingVehicleData and helps determine it's maxSpeed and movement force.
maxDragFloat0.0Intended to clamp the maximum drag available. Note: this field currently has no tangible effect in the engine's simulation..
jetForceFloat500.0Force generated by the vehicle's jet, if it has one. This field is only used by derived classes.
jetEnergyDrainFloat0.8Energy drained per tick by use of the vehicle's jet, if it has one.
minJetEnergyFloat1.0Minimum energy required in order to use the vehicle's jet, if it has one..
collDamageThresholdVelFloat20.0Note: this field currently has no tangible effect in the engine's simulation..
collDamageMultiplierFloat0.05Note: this field currently has no tangible effect in the engine's simulation..
minRollSpeedFloat0.0Note: this field currently has no tangible effect in the engine's simulation..

In the few next sections, we'll take a look at the datablocks which are derived from VehicleData: FlyingVehicleData, HoverVehicleData, and WheeledVehicleData.