00001 // Differential.h - the differential gear system of the drivetrain. 00002 // 00003 // Copyright (C) 2001--2004 Sam Varner 00004 // 00005 // This file is part of Vamos Automotive Simulator. 00006 // 00007 // This program is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 #ifndef _DIFFERENTIAL_H_ 00022 #define _DIFFERENTIAL_H_ 00023 00024 namespace Vamos_Body 00025 { 00026 // The differential gear system of the drivetrain. 00027 class Differential 00028 { 00029 // The differential's gear ratio. 00030 double m_final_drive; 00031 00032 double m_anti_slip; 00033 00034 // The angular speeds of the wheels. 00035 double m_left_wheel_speed; 00036 double m_right_wheel_speed; 00037 00038 double m_left_wheel_torque; 00039 double m_right_wheel_torque; 00040 00041 double get_anti_slip_torque () const; 00042 00043 public: 00044 Differential (double final_drive, double anti_slip); 00045 00046 double get_driveshaft_speed (double left_wheel_speed, 00047 double right_wheel_speed); 00048 00049 void find_wheel_torques (double driveshaft_torque); 00050 double left_wheel_torque () const { return m_left_wheel_torque; } 00051 double right_wheel_torque () const { return m_right_wheel_torque; } 00052 }; 00053 } 00054 00055 #endif // not _DIFFERENTIAL_H_
1.4.6