00001
00002
00003
00004
00005
00006
00007 #ifndef _REVOLUTE_JOINT_H
00008 #define _REVOLUTE_JOINT_H
00009
00010 #include <Physsim/Joint.h>
00011
00012 namespace Physsim {
00013
00015 class RevoluteJoint : public Joint
00016 {
00017 public:
00018 RevoluteJoint();
00019 virtual ~RevoluteJoint() {}
00020 virtual void clone(BasePtr& cloned, bimap<BasePtr, BasePtr>* obj_map = NULL) const;
00021 virtual void load_state(BaseConstPtr object, bimap<BasePtr, BasePtr>* correspondence = NULL);
00022 virtual void save_state(BasePtr object, bimap<BasePtr, BasePtr>* correspondence = NULL) const;
00023 RevoluteJoint(boost::weak_ptr<RigidBody> inboard, boost::weak_ptr<RigidBody> outboard);
00024 Vector3 get_axis_global() const;
00025 void set_axis_global(const Vector3& axis);
00026 void set_axis_local(const Vector3& axis);
00027 virtual void update_spatial_axes();
00028 virtual void determine_Q();
00029 virtual const Matrix4& get_transform();
00030 virtual const SMatrixN& get_spatial_axes_deriv(ReferenceFrameType type);
00031 virtual void load_from_xml(XMLTreeConstPtr node, std::map<std::string, BasePtr>& id_map);
00032 virtual void save_to_xml(XMLTreePtr node, std::list<BaseConstPtr>& shared_objects) const;
00033 virtual unsigned get_num_dof() const { return 1; }
00034
00036
00043 const Vector3& get_axis_local() const { return _u; }
00044
00046 virtual bool is_singular_config() const { return false; }
00047
00048 private:
00049 virtual void update_visualization();
00050
00052 Vector3 _u;
00053
00055 Matrix4 _T;
00056
00058 SMatrixN _si_deriv;
00059 };
00060 }
00061
00062 #endif