00001 00002 #ifndef _VRSODE_SHAPE_H_ 00003 #define _VRSODE_SHAPE_H_ 00004 00005 #include <ode/ode.h> 00006 #include <vrs/sharedobj.h> 00007 #include <vrs/sg/scenething.h> 00008 #include <vrs/rotation.h> 00009 00010 #include "random_utils/AutoLocker.h" 00011 00012 #include "CollisionShape.h" 00013 00014 namespace vrsode 00015 { 00016 00022 class Shape : public VRS::SharedObj 00023 { 00024 CollisionShape m_collisionShape; 00025 VRS::SO<VRS::SceneThing> m_debugNode; 00026 VRS::Vector m_offsetCenter; 00027 VRS::SO<VRS::Rotation> m_offsetRotation; 00028 dGeomID m_geomId; 00029 bool m_debugNodeActive; 00030 00031 public: 00035 Shape(); 00036 00040 virtual ~Shape(); 00041 00045 VRS::SO<VRS::SceneThing> debugNode(); 00046 00050 VRS::Vector offsetCenter(); 00051 00055 void setOffsetCenter(VRS::Vector); 00056 00060 VRS::SO<VRS::Rotation> offsetRotation(); 00061 00065 void setOffsetRotation(VRS::SO<VRS::Rotation>); 00066 00070 virtual CollisionShape collisionShape(); 00071 00075 dGeomID geomId(); 00076 00080 void activateDebugNode(bool = true); 00081 00085 bool debugNodeActive(); 00086 00087 protected: 00091 virtual void createGeometry() = 0; 00092 00096 virtual void createDebugNode() = 0; 00097 00098 void setDebugNode(VRS::SO<VRS::SceneThing>); 00099 void setCollisionShape(CollisionShape); 00100 void setGeomId(dGeomID); 00101 }; 00102 00103 } 00104 00105 #endif 00106 00107
1.5.1