Changeset - r15625:2ee9e0168398
[Not reviewed]
master
0 4 0
terkhen - 14 years ago 2010-08-02 14:49:23
terkhen@openttd.org
(svn r20299) -Add: Make trains and road vehicles use a different area value to calculate air drag.
4 files changed with 20 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/ground_vehicle.cpp
Show inline comments
 
@@ -107,7 +107,7 @@ int GroundVehicle<T, Type>::GetAccelerat
 

	
 
	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;
src/ground_vehicle.hpp
Show inline comments
 
@@ -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;
src/roadveh.h
Show inline comments
 
@@ -210,6 +210,15 @@ protected: // These functions should not
 
		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.
src/train.h
Show inline comments
 
@@ -433,6 +433,15 @@ protected: // These functions should not
 
	}
 

	
 
	/**
 
	 * 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.
 
	 */
0 comments (0 inline, 0 general)