Body.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 BODY_HH
00028 #define BODY_HH
00029
00030 #include <ode/ode.h>
00031 #include <list>
00032 #include <vector>
00033
00034 #include "UpdateParams.hh"
00035 #include "XMLConfig.hh"
00036 #include "Entity.hh"
00037 #include "Pose3d.hh"
00038
00039 namespace gazebo
00040 {
00041 class Geom;
00042 class Sensor;
00043
00047
00049 class Body : public Entity
00050 {
00052 public: Body(Entity *parent, dWorldID worldId);
00053
00055 public: virtual ~Body();
00056
00059 public: virtual void Load(XMLConfigNode *node);
00060
00062 public: virtual void Save();
00063
00065 public: virtual void Init();
00066
00068 public: void Fini();
00069
00071 public: virtual void Update(UpdateParams ¶ms);
00072
00075 public: void AttachGeom( Geom *geom );
00076
00079 public: void SetPose(const Pose3d &pose);
00080
00083 public: Pose3d GetPose() const;
00084
00087 public: void SetPosition(const Vector3 &pos);
00088
00091 public: void SetRotation(const Quatern &rot);
00092
00095 public: Vector3 GetPosition() const;
00096
00099 public: Quatern GetRotation() const;
00100
00103 public: dBodyID GetId() const;
00104
00106 public: void SetEnabled(bool enable) const;
00107
00109 public: void UpdateCoM();
00110
00112 public: const Pose3d &GetCoMPose() const;
00113
00115 public: void SetGravityMode(bool mode);
00116
00118 public: void SetLinearVel(const Vector3 &vel);
00119
00121 public: Vector3 GetLinearVel() const;
00122
00124 public: void SetAngularVel(const Vector3 &vel);
00125
00127 public: Vector3 GetAngularVel() const;
00128
00130 public: void SetForce(const Vector3 &force);
00131
00133 public: Vector3 GetForce() const;
00134
00136 public: void SetTorque(const Vector3 &force);
00137
00139 public: Vector3 GetTorque() const;
00140
00143 private: void LoadGeom(XMLConfigNode *node);
00144
00147 private: void LoadSensor(XMLConfigNode *node);
00148
00150 private: void LoadVisual(XMLConfigNode *node);
00151
00153 private: std::vector< Geom* > geoms;
00154
00156 private: std::vector< Sensor* > sensors;
00157
00159 private: XMLConfigNode *xmlNode;
00160
00162 private: dBodyID bodyId;
00163
00165 private: dMass mass;
00166
00167 private: bool isStatic;
00168
00169 private: Pose3d comPose;
00170 private: Pose3d staticPose;
00171 };
00172
00174 }
00175 #endif