Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

joint.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: joint.h,v 1.7 2004/05/02 11:44:41 rollmark Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 #ifndef OXYGEN_JOINT_H
00023 #define OXYGEN_JOINT_H
00024 
00025 #include "odeobject.h"
00026 
00027 namespace oxygen
00028 {
00029 class Body;
00030 
00049 class Joint : public ODEObject
00050 {
00051 public:
00052     enum EBodyIndex
00053         {
00054             BI_FIRST = 0,
00055             BI_SECOND = 1
00056         };
00057 
00058     enum EAxisIndex
00059         {
00060             AI_FIRST = 0,
00061             AI_SECOND = 1,
00062             AI_THIRD = 2
00063         };
00064 
00065     Joint();
00066     virtual ~Joint();
00067 
00075     virtual void Attach(boost::shared_ptr<Body> body1,
00076                         boost::shared_ptr<Body> body2);
00077 
00082     void Attach(const std::string& path1, const std::string& path2);
00083 
00087     boost::shared_ptr<Body> GetBody(EBodyIndex idx);
00088 
00090     static boost::shared_ptr<Joint> GetJoint(dJointID id);
00091 
00097     int GetType();
00098 
00101     static bool AreConnected (boost::shared_ptr<Body> body1,
00102                               boost::shared_ptr<Body> body2);
00103 
00108     static bool AreConnectedExcluding (boost::shared_ptr<Body> body1,
00109                                        boost::shared_ptr<Body> body2,
00110                                        int joint_type);
00111 
00119     void EnableFeedback(bool enable);
00120 
00123     bool FeedBackEnabled();
00124 
00128     salt::Vector3f GetFeedbackForce(EBodyIndex idx);
00129 
00133     salt::Vector3f GetFeedbackTorque(EBodyIndex idx);
00134 
00139     void SetBounce(EAxisIndex idx, float bounce);
00140 
00142     float GetBounce(EAxisIndex idx);
00143 
00147     void SetLowStopDeg(EAxisIndex idx, float deg);
00148 
00150     float GetLowStopDeg(EAxisIndex idx);
00151 
00155     void SetHighStopDeg(EAxisIndex idx, float deg);
00156 
00158     float GetHighStopDeg(EAxisIndex idx);
00159 
00161     void SetLowStopPos(EAxisIndex idx, float deg);
00162 
00164     float GetLowStopPos(EAxisIndex idx);
00165 
00167     void SetHighStopPos(EAxisIndex idx, float deg);
00168 
00170     float GetHighStopPos(EAxisIndex idx);
00171 
00174     void SetCFM(EAxisIndex idx, float cfm);
00175 
00178     float GetCFM(EAxisIndex idx);
00179 
00186     void SetStopCFM(EAxisIndex idx, float cfm);
00187 
00189     float GetStopCFM(EAxisIndex idx);
00190 
00192     void SetStopERP(EAxisIndex idx, float erp);
00193 
00195     float GetStopERP(EAxisIndex idx);
00196 
00200     void SetSuspensionERP(EAxisIndex idx, float erp);
00201 
00205     float GetSuspensionERP(EAxisIndex idx);
00206 
00210     void SetSuspensionCFM(EAxisIndex idx, float cfm);
00211 
00215     float GetSuspensionCFM(EAxisIndex idx);
00216 
00218     void SetLinearMotorVelocity(EAxisIndex idx, float vel);
00219 
00221     float GetLinearMotorVelocity(EAxisIndex idx);
00222 
00224     void SetAngularMotorVelocity(EAxisIndex idx, float deg);
00225 
00227     float GetAngularMotorVelocity(EAxisIndex idx);
00228 
00234     void SetMaxMotorForce(EAxisIndex idx, float f);
00235 
00239     float GetMaxMotorForce(EAxisIndex idx);
00240 
00241 protected:
00243     virtual void OnLink();
00244 
00246     boost::shared_ptr<Body> GetBody(const std::string& path);
00247 
00249     virtual void SetParameter(int parameter, float value) = 0;
00250 
00252     virtual float GetParameter(int parameter) = 0;
00253 
00254 protected:
00256     dJointID mODEJoint;
00257 
00259     boost::shared_ptr<dJointFeedback> mFeedback;
00260 };
00261 
00262 DECLARE_ABSTRACTCLASS(Joint);
00263 
00264 } // namespace oxygen
00265 
00266 #endif // OXYGEN_JOINT_H

Generated on Thu Apr 6 15:25:38 2006 for rcssserver3d by  doxygen 1.4.4