Body.hh
00001 #ifndef BODY_HH
00002 #define BODY_HH
00003
00004 #include <ode/ode.h>
00005 #include <boost/any.hpp>
00006 #include <list>
00007 #include <vector>
00008
00009 #include "UpdateParams.hh"
00010 #include "XMLConfig.hh"
00011 #include "Entity.hh"
00012 #include "Pose3d.hh"
00013
00014 namespace Ogre
00015 {
00016 class SceneNode;
00017 }
00018
00019 namespace gazebo
00020 {
00021 class Geom;
00022 class Sensor;
00023
00027
00029 class Body : public Entity
00030 {
00032 public: Body(Entity *parent, dWorldID worldId);
00033
00035 public: virtual ~Body();
00036
00040 public: virtual int Load(XMLConfigNode *node);
00041
00044 public: virtual int Init();
00045
00047 public: void Fini();
00048
00051 public: virtual int Update(UpdateParams ¶ms);
00052
00055 public: void AttachGeom( Geom *geom );
00056
00059 public: void SetPose(const Pose3d &pose);
00060
00063 public: Pose3d GetPose() const;
00064
00067 public: void SetPosition(const Vector3 &pos);
00068
00071 public: void SetRotation(const Quatern &rot);
00072
00075 public: Vector3 GetPosition() const;
00076
00079 public: Quatern GetRotation() const;
00080
00083 public: dBodyID GetId() const;
00084
00086 public: void SetEnabled(bool enable) const;
00087
00089 public: void UpdateCoM();
00090
00092 public: const Pose3d &GetCoMPose() const;
00093
00095 public: void SetGravityMode(bool mode);
00096
00100 private: int LoadGeom(XMLConfigNode *node);
00101
00104 private: void LoadSensor(XMLConfigNode *node);
00105
00107 private: std::vector< Geom* > geoms;
00108
00110 private: std::vector< Sensor* > sensors;
00111
00113 private: dBodyID bodyId;
00114
00116 private: dMass mass;
00117
00118 private: std::string name;
00119
00120 private: bool isStatic;
00121
00122 private: Pose3d comPose;
00123 private: Pose3d staticPose;
00124 };
00125
00127 }
00128 #endif