00001 // Clutch.h - a clutch for the drivetrain. 00002 // 00003 // Copyright (C) 2001 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 _CLUTCH_H_ 00022 #define _CLUTCH_H_ 00023 00024 namespace Vamos_Body 00025 { 00026 //* A clutch for the drivetrain. 00027 class Clutch 00028 { 00029 // The coefficient of friction for the clutch plates. 00030 double m_sliding_friction; 00031 00032 // The effective radius of the clutch plates. 00033 double m_radius; 00034 00035 // The contact area. 00036 double m_area; 00037 00038 // The current pressure on the plates. 00039 double m_pressure; 00040 00041 // The maximum allowed pressure on the plates. 00042 double m_max_pressure; 00043 00044 // The locking threshold. The clutch pretends to be fully engaged 00045 // when engine speed - transmission speeds < m_threshold * normal 00046 // force. 00047 double m_threshold; 00048 00049 // true if the clutch is fully engaged, false otherwise. 00050 bool m_engaged; 00051 00052 public: 00053 //** Constructor 00054 Clutch (double sliding, double radius, double area, double max_pressure); 00055 00056 // Return the drag caused by friction between the clutch plates. 00057 double drag (double engine_speed, double drive_speed); 00058 00059 // Set the pressure on the plates to FACTOR * m_max_pressure. If 00060 // FACTOR >= 1.0, the clutch is fully engaged. 00061 void position (double factor); 00062 00063 // Return the current pressure. 00064 double pressure () const { return m_pressure; } 00065 00066 // Return the maximum presure. 00067 double max_pressure () const { return m_max_pressure; } 00068 00069 // Return true if the clutch is fully engaged, false otherwise. 00070 bool engaged () const { return m_engaged; } 00071 }; 00072 } 00073 00074 #endif // !_CLUTCH_H_
1.4.6