Geom.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 GEOM_HH
00028 #define GEOM_HH
00029
00030 #include <ode/ode.h>
00031
00032 #include "Entity.hh"
00033 #include "Pose3d.hh"
00034 #include "Vector3.hh"
00035
00036 namespace gazebo
00037 {
00038
00039 class Body;
00040 class ContactParams;
00041 class XMLConfigNode;
00042 class OgreVisual;
00043
00047
00049 class Geom : public Entity
00050 {
00051
00053
00054 public: Geom(Body *body);
00055
00057 public: virtual ~Geom();
00058
00060 public: virtual void Load(XMLConfigNode *node);
00061
00063 public: virtual void Save();
00064
00066 protected: virtual void LoadChild(XMLConfigNode *node) = 0;
00067
00069 public: void SetGeom(dGeomID geomId, bool placeable);
00070
00072 public: void Update();
00073
00075 public: virtual void UpdateChild() {};
00076
00079 public: dGeomID GetGeomId() const;
00080
00083 public: dGeomID GetTransId() const;
00084
00086 public: int GetGeomClass() const;
00087
00089 public: bool IsPlaceable() const;
00090
00094 public: void SetPose(const Pose3d &pose, bool updateCoM=true);
00095
00097 public: Pose3d GetPose() const;
00098
00101 public: void SetPosition(const Vector3 &pos);
00102
00105 public: void SetRotation(const Quatern &rot);
00106
00109 public: void SetCategoryBits(unsigned int bits);
00110
00113 public: void SetCollideBits(unsigned int bits);
00114
00116 public: const dMass *GetBodyMassMatrix();
00117
00119 public: void SetLaserFiducialId(int id);
00120
00122 public: int GetLaserFiducialId() const;
00123
00125 public: void SetLaserRetro(float retro);
00126
00128 public: float GetLaserRetro() const;
00129
00131 public: void SetTransparency( float trans );
00132
00134 public: float GetTransparency() const;
00135
00137 public: void ShowBoundingBox(bool show);
00138
00140 public: void ShowJoints(bool show);
00141
00143 public: void ShowPhysics(bool);
00144
00146 private: void PlaceImmovable( );
00147
00149 public: virtual void SetImmovableBasePose( const Pose3d & pose );
00150
00152 public: ContactParams *contact;
00153
00155 protected: Body *body;
00156
00157 private: bool placeable;
00158
00160 protected: dGeomID transId;
00161
00163 protected: dGeomID geomId;
00164
00165 private: static int geomIdCounter;
00166
00168 protected: dMass mass;
00169
00171 protected: dMass bodyMass;
00172
00173 private: int laserFiducialId;
00174 private: float laserRetro;
00175
00177 protected: double dblMass;
00178
00180 private: OgreVisual *bbVisual;
00181
00182 private: float transparency;
00183
00185 private: std::vector<OgreVisual*> visuals;
00186
00188 private: XMLConfigNode *xmlNode;
00189
00190 private: Pose3d immovableBasePose;
00191 private: Pose3d immovableRelativePose;
00192
00193 };
00194
00196
00197 }
00198 #endif