00001 // Brake.h - a brake for a wheel. 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 _BRAKE_H_ 00022 #define _BRAKE_H_ 00023 00024 namespace Vamos_Body 00025 { 00026 //* A brake for a wheel. 00027 class Brake 00028 { 00029 // The sliding coefficient of friction for the brake pads on the 00030 // rotor. 00031 double m_friction; 00032 00033 // The effective radius of the rotor. 00034 double m_radius; 00035 00036 // The area of the brake pads. 00037 double m_area; 00038 00039 // The maximum allowed pressure. 00040 double m_max_pressure; 00041 00042 // The fraction of the pressure to be applied to the brake. 00043 double m_bias; 00044 00045 // The brake locks when the linear brake velocity divided by pl 00046 double m_threshold; 00047 00048 // true if the brake is locked, false otherwise. 00049 bool m_is_locked; 00050 00051 // coefficient to multiply the brakes by for handbrakes 00052 double m_handbrake; 00053 00054 public: 00055 //** Constructor 00056 Brake (double slide, double radius, double area, double max_pressure, 00057 double bias, double handbrake); 00058 00059 // Return the torque exerted on the wheel by the brake. 00060 double torque (double factor, double rotational_velocity); 00061 00062 double handbrake() {return m_handbrake;} 00063 00064 // Rerturn true if the brake is locked, false otherwise. 00065 bool is_locked () const { return m_is_locked; } 00066 }; 00067 } 00068 00069 #endif // !_BRAKE_H_
1.4.6