(svn r20299) -Add: Make trains and road vehicles use a different area value to calculate air drag.

pull/155/head
terkhen 14 years ago
parent 094841cba3
commit f33a0370ae

@ -107,7 +107,7 @@ int GroundVehicle<T, Type>::GetAcceleration() const
bool maglev = v->GetAccelerationType() == 2;
const int area = 120;
const int area = v->GetAirDragArea();
if (!maglev) {
resistance = (13 * mass) / 10;
resistance += this->acc_cache.cached_axle_resistance;

@ -54,6 +54,7 @@ enum GroundVehicleFlags {
* virtual uint16 GetPoweredPartPower(const T *head) const = 0;
* virtual uint16 GetWeight() const = 0;
* virtual byte GetTractiveEffort() const = 0;
* virtual byte GetAirDragArea() const = 0;
* virtual AccelStatus GetAccelerationStatus() const = 0;
* virtual uint16 GetCurrentSpeed() const = 0;
* virtual uint32 GetRollingFriction() const = 0;

@ -210,6 +210,15 @@ protected: // These functions should not be called outside acceleration code.
return RoadVehInfo(this->engine_type)->tractive_effort;
}
/**
* Gets the area used for calculating air drag.
* @return Area of the engine.
*/
FORCEINLINE byte GetAirDragArea() const
{
return 60;
}
/**
* Checks the current acceleration status of this vehicle.
* @return Acceleration status.

@ -432,6 +432,15 @@ protected: // These functions should not be called outside acceleration code.
return GetVehicleProperty(this, PROP_TRAIN_TRACTIVE_EFFORT, RailVehInfo(this->engine_type)->tractive_effort);
}
/**
* Gets the area used for calculating air drag.
* @return Area of the engine.
*/
FORCEINLINE byte GetAirDragArea() const
{
return 120;
}
/**
* Checks the current acceleration status of this vehicle.
* @return Acceleration status.

Loading…
Cancel
Save