added body parameter to loadPhy()

git-svn-id: svn://anubis/misc/OdeWorld@156 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2009-10-01 03:21:04 +00:00
parent fcdbce9829
commit 6a6ad94c71
2 changed files with 6 additions and 7 deletions

View File

@ -80,10 +80,9 @@ void OdeWorld::worldStep()
} }
vector<dGeomID> OdeWorld::loadPhy(const std::string & path, vector<dGeomID> OdeWorld::loadPhy(const std::string & path,
bool static_data) dBodyID * body, bool static_data)
{ {
vector<dGeomID> ret; vector<dGeomID> ret;
dBodyID body = 0;
ifstream ifs(path.c_str()); ifstream ifs(path.c_str());
if (ifs.is_open()) if (ifs.is_open())
@ -123,19 +122,19 @@ vector<dGeomID> OdeWorld::loadPhy(const std::string & path,
} }
if (type == "cube") if (type == "cube")
{ {
ret.push_back(addCube(name, static_data, &body, args)); ret.push_back(addCube(name, static_data, body, args));
} }
else if (type == "sphere") else if (type == "sphere")
{ {
ret.push_back(addSphere(name, static_data, &body, args)); ret.push_back(addSphere(name, static_data, body, args));
} }
else if (type == "cylinder") else if (type == "cylinder")
{ {
ret.push_back(addCylinder(name, static_data, &body, args)); ret.push_back(addCylinder(name, static_data, body, args));
} }
else if (type == "plane") else if (type == "plane")
{ {
ret.push_back(addPlane(name, static_data, &body, args)); ret.push_back(addPlane(name, static_data, body, args));
} }
} }
} }

View File

@ -18,7 +18,7 @@ class OdeWorld
} }
void worldStep(); void worldStep();
std::vector<dGeomID> loadPhy(const std::string & path, std::vector<dGeomID> loadPhy(const std::string & path,
bool static_data = false); dBodyID * body, bool static_data = false);
dGeomID addCube(const std::string & name, bool static_data, dGeomID addCube(const std::string & name, bool static_data,
dBodyID * body, const std::vector<float> args); dBodyID * body, const std::vector<float> args);
dGeomID addSphere(const std::string & name, bool static_data, dGeomID addSphere(const std::string & name, bool static_data,