OdeWorld/OdeWorld.h
josh 6a6ad94c71 added body parameter to loadPhy()
git-svn-id: svn://anubis/misc/OdeWorld@156 bd8a9e45-a331-0410-811e-c64571078777
2009-10-01 03:21:04 +00:00

49 lines
1.6 KiB
C++

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