Joint.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef JOINT_HH
00028 #define JOINT_HH
00029
00030 #include <ode/ode.h>
00031
00032 #include "Vector3.hh"
00033
00034
00035 namespace gazebo
00036 {
00040
00041 class Body;
00042 class XMLConfigNode;
00043
00045 class Joint
00046 {
00048 public: enum Type {SLIDER, HINGE, HINGE2, BALL, UNIVERSAL};
00049
00051 public: Joint();
00052
00054 public: virtual ~Joint();
00055
00057 public: void Load(XMLConfigNode *node);
00058
00060 protected: virtual void LoadChild(XMLConfigNode *node) {};
00061
00063 public: Joint::Type GetType() const;
00064
00066 public: Body *GetJointBody( int index ) const;
00067
00069 public: bool AreConnected( Body *one, Body *two ) const;
00070
00072 public: virtual double GetParam(int parameter) const;
00073
00076 public: void SetFixed();
00077
00079 public: void Attach( Body *one, Body *two );
00080
00082 public: void Detach();
00083
00085 public: virtual void SetAnchor( const gazebo::Vector3 & ) {}
00086
00088 public: virtual gazebo::Vector3 GetAnchor() const
00089 {return gazebo::Vector3(0,0,0);}
00090
00091
00093 public: virtual void SetParam( int parameter, double value );
00094
00096 public: std::string GetName() const;
00097
00099 public: void SetName(const std::string &name);
00100
00102 protected: dJointID jointId;
00103
00105 protected: Type type;
00106
00108 private: Body *body1;
00109
00111 private: Body *body2;
00112
00114 private: std::string name;
00115
00116 };
00117
00119 }
00120 #endif
00121