00001 /*************************************************************************** 00002 HingeJoint.h - description 00003 ------------------- 00004 begin : Mon Mar 17 2003 00005 copyright : (C) 2003 by Yann Le-Guyadec et Michel Dubois 00006 email : Yann.Le-Guyadec@univ-ubs.fr et Michel.Dubois@univ-ubs.fr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef __SIM_HINGEJOINT_H__ 00019 #define __SIM_HINGEJOINT_H__ 00020 00021 #include "SimJoint.h" 00022 #include "Vector3.h" 00028 class SimRigidBody; 00029 00030 class HingeJoint : public SimJoint 00031 { 00032 public: 00033 HingeJoint (SimRigidBody * rigidBody1, SimRigidBody * RigidBody2); 00034 virtual ~HingeJoint (); 00035 00036 public: 00037 void set (char * name, char * value); 00038 00039 void setAnchor (const Vector3& anchor); 00040 void setAxis (const Vector3& axis1); 00041 void setMaxForce (const Real maxForce1); 00042 void setTargetVelocity (const Real velocity); 00043 Real getAngle(); 00044 Real getAngleRate(); 00045 void setParam (const int odeparameter,const Real value); 00046 Real getParam (int odeparameter) const; 00047 void print() const; 00048 00049 }; 00050 00051 #include "Joint.h" 00052 #include "Vector3.h" 00058 class RigidBody; 00059 00060 class OldHingeJoint : public Joint, public Connection, public Controller 00061 { 00062 public: 00063 OldHingeJoint (SimRigidBody * rigidBody1, SimRigidBody * RigidBody2); 00064 virtual ~OldHingeJoint (); 00065 00066 public: 00067 void set (char * name, char * value); 00068 00069 void setAnchor (const Vector3& anchor); 00070 void setAxis (const Vector3& axis1); 00071 void setMaxForce (const Real maxForce1); 00072 void setTargetVelocity (const Real velocity); 00073 Real getAngle(); 00074 Real getAngleRate(); 00075 void setParam (const int odeparameter,const Real value); 00076 Real getParam (int odeparameter) const; 00077 void swap(); 00078 void print() const; 00079 void setIsEnabled(bool isEnabled); 00080 00081 00082 }; 00083 00084 #endif