From 6a6ad94c71afd80a11bdb715ac0bfa0fdf44a789 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 1 Oct 2009 03:21:04 +0000 Subject: [PATCH] added body parameter to loadPhy() git-svn-id: svn://anubis/misc/OdeWorld@156 bd8a9e45-a331-0410-811e-c64571078777 --- OdeWorld.cc | 11 +++++------ OdeWorld.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OdeWorld.cc b/OdeWorld.cc index 149d210..548c2e8 100644 --- a/OdeWorld.cc +++ b/OdeWorld.cc @@ -80,10 +80,9 @@ void OdeWorld::worldStep() } vector OdeWorld::loadPhy(const std::string & path, - bool static_data) + dBodyID * body, bool static_data) { vector ret; - dBodyID body = 0; ifstream ifs(path.c_str()); if (ifs.is_open()) @@ -123,19 +122,19 @@ vector OdeWorld::loadPhy(const std::string & path, } 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") { - ret.push_back(addSphere(name, static_data, &body, args)); + ret.push_back(addSphere(name, static_data, body, args)); } 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") { - ret.push_back(addPlane(name, static_data, &body, args)); + ret.push_back(addPlane(name, static_data, body, args)); } } } diff --git a/OdeWorld.h b/OdeWorld.h index 83300b3..1eba4cb 100644 --- a/OdeWorld.h +++ b/OdeWorld.h @@ -18,7 +18,7 @@ class OdeWorld } void worldStep(); std::vector loadPhy(const std::string & path, - bool static_data = false); + dBodyID * body, 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,