added skeleton add{Cube,Sphere,Cylinder,Plane} methods to OdeWorld
git-svn-id: svn://anubis/misc/OdeWorld@149 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
25ef8f61d7
commit
d234e0147f
46
OdeWorld.cc
46
OdeWorld.cc
@ -83,6 +83,7 @@ vector<dGeomID> OdeWorld::loadPhy(const std::string & path,
|
||||
bool static_data)
|
||||
{
|
||||
vector<dGeomID> ret;
|
||||
dBodyID body = 0;
|
||||
|
||||
ifstream ifs(path.c_str());
|
||||
if (ifs.is_open())
|
||||
@ -120,8 +121,53 @@ vector<dGeomID> OdeWorld::loadPhy(const std::string & path,
|
||||
break;
|
||||
pos = pos2 + 1;
|
||||
}
|
||||
if (type == "cube")
|
||||
{
|
||||
ret.push_back(addCube(name, static_data, &body, args));
|
||||
}
|
||||
else if (type == "sphere")
|
||||
{
|
||||
ret.push_back(addSphere(name, static_data, &body, args));
|
||||
}
|
||||
else if (type == "cylinder")
|
||||
{
|
||||
ret.push_back(addCylinder(name, static_data, &body, args));
|
||||
}
|
||||
else if (type == "plane")
|
||||
{
|
||||
ret.push_back(addPlane(name, static_data, &body, args));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
dGeomID OdeWorld::addCube(const string & name, bool static_data,
|
||||
dBodyID * body, const vector<float> args)
|
||||
{
|
||||
if (args.size() != 9)
|
||||
return 0;
|
||||
}
|
||||
|
||||
dGeomID OdeWorld::addSphere(const string & name, bool static_data,
|
||||
dBodyID * body, const vector<float> args)
|
||||
{
|
||||
if (args.size() != 4)
|
||||
return 0;
|
||||
}
|
||||
|
||||
dGeomID OdeWorld::addCylinder(const string & name, bool static_data,
|
||||
dBodyID * body, const vector<float> args)
|
||||
{
|
||||
if (args.size() != 8)
|
||||
return 0;
|
||||
}
|
||||
|
||||
dGeomID OdeWorld::addPlane(const string & name, bool static_data,
|
||||
dBodyID * body, const vector<float> args)
|
||||
{
|
||||
if (args.size() != 6)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,14 @@ class OdeWorld
|
||||
void worldStep();
|
||||
std::vector<dGeomID> loadPhy(const std::string & path,
|
||||
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 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user