#ifndef ODEWORLD_H #define ODEWORLD_H #include #include #include #include class OdeWorld { public: OdeWorld(); ~OdeWorld(); void setGravity(float x, float y, float z) { dWorldSetGravity(m_world, x, y, z); } void worldStep(); std::vector loadPhy(const std::string & path, bool static_data = false); dGeomID addCube(const std::string & name, bool static_data, dBodyID * body, const std::vector args); dGeomID addSphere(const std::string & name, bool static_data, dBodyID * body, const std::vector args); dGeomID addCylinder(const std::string & name, bool static_data, dBodyID * body, const std::vector args); dGeomID addCCylinder(const std::string & name, bool static_data, dBodyID * body, const std::vector args); dGeomID addPlane(const std::string & name, bool static_data, dBodyID * body, const std::vector args); friend void OdeWorld_collide_callback(void * data, dGeomID o1, dGeomID o2); protected: dWorldID m_world; dSpaceID m_space; dJointGroupID m_contactJointGroup; std::map m_objects; void setupGeom(const std::string & name, bool static_data, dBodyID * body, dGeomID geom, bool placeable, float locx, float locy, float locz, float rotx, float roty, float rotz); }; #endif