VehicleData
Base properties shared by all Vehicles (FlyingVehicle, HoverVehicle, WheeledVehicle).
Public Attributes
float
Damage to this vehicle after a collision (multiplied by collision velocity).
float
Minimum collision velocity to cause damage to this vehicle.
damageEmitter [3]
Array of particle emitters used to generate damage (dust, smoke etc) effects.
Point3F
Object space "x y z" offsets used to emit particles for the active damageEmitter.
float
Damage levels (as a percentage of maxDamage) above which to begin emitting particles from the associated damageEmitter.
float
Energy amount to drain for each tick the vehicle is jetting.
float
Additional force applied to the vehicle when it is jetting.
float
Maximum yaw (horizontal) and pitch (vertical) steering angle in radians.
float
Minimum vehicle energy level to begin jetting.
float
Number of damageEmitterOffset values to use for each damageEmitter.
bool
If true, steering does not auto-centre while the vehicle is being steered by its driver.
float
Rate at which the vehicle's steering returns to forwards when it is moving.
float
Amount of effect the vehicle's speed has on its rate of steering return.
Detailed Description
Base properties shared by all Vehicles (FlyingVehicle, HoverVehicle, WheeledVehicle).
This datablock defines properties shared by all Vehicle types, but should not be instantiated directly. Instead, set the desired properties in the FlyingVehicleData, HoverVehicleData or WheeledVehicleData datablock.
Damage
The VehicleData class extends the basic energy/damage functionality provided by ShapeBaseData to include damage from collisions, as well as particle emitters activated automatically when damage levels reach user specified thresholds.
The example below shows how to setup a Vehicle to:
take damage when colliding with another object
emit gray smoke particles from two locations on the Vehicle when damaged above 50%
emit black smoke particles from two locations on the Vehicle when damaged above 85%
emit bubbles when any active damage emitter point is underwater
// damage from collisions collDamageMultiplier = 0.05; collDamageThresholdVel = 15; // damage levels damageLevelTolerance[0] = 0.5; damageEmitter[0] = GraySmokeEmitter; // emitter used when damage is >= 50% damageLevelTolerance[1] = 0.85; damageEmitter[1] = BlackSmokeEmitter; // emitter used when damage is >= 85% damageEmitter[2] = DamageBubbleEmitter; // emitter used instead of damageEmitter[0:1] // when offset point is underwater // emit offsets (used for all active damage level emitters) damageEmitterOffset[0] = "0.5 3 1"; damageEmitterOffset[1] = "-0.5 3 1"; numDmgEmitterAreas = 2;
Public Attributes
float collDamageMultiplier
Damage to this vehicle after a collision (multiplied by collision velocity).
Currently unused.
float collDamageThresholdVel
Minimum collision velocity to cause damage to this vehicle.
Currently unused.
ParticleEmitterData damageEmitter [3]
Array of particle emitters used to generate damage (dust, smoke etc) effects.
Currently, the first two emitters (indices 0 and 1) are used when the damage level exceeds the associated damageLevelTolerance. The 3rd emitter is used when the emitter point is underwater.
Point3F damageEmitterOffset [2]
Object space "x y z" offsets used to emit particles for the active damageEmitter.
// damage levels damageLevelTolerance[0] = 0.5; damageEmitter[0] = SmokeEmitter; // emit offsets (used for all active damage level emitters) damageEmitterOffset[0] = "0.5 3 1"; damageEmitterOffset[1] = "-0.5 3 1"; numDmgEmitterAreas = 2;
float damageLevelTolerance [2]
Damage levels (as a percentage of maxDamage) above which to begin emitting particles from the associated damageEmitter.
Levels should be in order of increasing damage.
float jetEnergyDrain
Energy amount to drain for each tick the vehicle is jetting.
Once the vehicle's energy level reaches 0, it will no longer be able to jet.
float jetForce
Additional force applied to the vehicle when it is jetting.
For WheeledVehicles, the force is applied in the forward direction. For FlyingVehicles, the force is applied in the thrust direction.
float maxSteeringAngle
Maximum yaw (horizontal) and pitch (vertical) steering angle in radians.
float minJetEnergy
Minimum vehicle energy level to begin jetting.
float numDmgEmitterAreas
Number of damageEmitterOffset values to use for each damageEmitter.
bool powerSteering
If true, steering does not auto-centre while the vehicle is being steered by its driver.
float steeringReturn
Rate at which the vehicle's steering returns to forwards when it is moving.
float steeringReturnSpeedScale
Amount of effect the vehicle's speed has on its rate of steering return.