00001 // Exerter.h - something that can exert forces, impulses, and torques. 00002 // 00003 // Copyright (C) 2002 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 _EXERTER_H_ 00022 #define _EXERTER_H_ 00023 00024 #include <vamos/geometry/Three_Vector.h> 00025 00026 namespace Vamos_Body 00027 { 00028 //* An Exerter is capable of producing forces, impulses, and 00029 //torques. These exertions cannot be applied to a rigid body 00030 //because an exerter has no location or orientation. See Particle. 00031 class Exerter 00032 { 00033 protected: 00034 // The resultant force exerted by the component. 00035 Vamos_Geometry::Three_Vector m_force; 00036 00037 // The impulse exerted by the component. 00038 Vamos_Geometry::Three_Vector m_impulse; 00039 00040 // The resultant torque exerted by the component. 00041 Vamos_Geometry::Three_Vector m_torque; 00042 00043 public: 00044 //** Constructor 00045 Exerter () {}; 00046 00047 //** Destructor 00048 virtual ~Exerter () {}; 00049 00050 // Find and store the forces, impulses, and torques for the 00051 // current configuration. 00052 virtual void find_forces () {}; 00053 00054 // Propagate the Particle forward in time by TIME. 00055 virtual void propagate (double time) {}; 00056 00057 // Undo the last propagation. 00058 virtual void rewind () {}; 00059 00060 // Do any necessary cleanup at the end of a time step. 00061 virtual void end_timestep () {}; 00062 00063 // Return the force exerted on the rigid body in the body's frame. 00064 virtual Vamos_Geometry::Three_Vector force () const { return m_force; } 00065 00066 // Return the impulse exerted on the rigid body in the body's 00067 // frame. 00068 virtual Vamos_Geometry::Three_Vector impulse () const { return m_impulse; } 00069 00070 // Return the torque exerted on the rigid body in the body's frame. 00071 virtual Vamos_Geometry::Three_Vector torque () const { return m_torque; } 00072 00073 // Set the force, impulse and torque to zero; 00074 virtual void reset (); 00075 }; 00076 } 00077 00078 #endif // not _EXERTER_H_
1.4.6