diff --git a/src/Engine.cc b/src/Engine.cc index bed1c62..79bf433 100644 --- a/src/Engine.cc +++ b/src/Engine.cc @@ -604,7 +604,10 @@ int Engine::loadModel(const string & name, bool is_static, bool is_reference, Engine::Object * engine_obj = getObject(id); if (engine_obj != NULL) { - engine_obj->loadPhy(m_fileLoader, phys_path); + unsigned int size; + unsigned char *phy_data = loadFile(phys_path, &size); + engine_obj->loadPhy(phy_data, size); + free(phy_data); } return id; } diff --git a/src/Engine.h b/src/Engine.h index 2a27ef5..e48a068 100644 --- a/src/Engine.h +++ b/src/Engine.h @@ -33,7 +33,7 @@ class Engine void setPosition(double x, double y, double z); void getPosition(double * x, double * y, double * z); - void loadPhy(FileLoader * fl, const FileLoader::Path & path); + void loadPhy(unsigned char *data, unsigned int size); void instantiatePhy(); void setVisible(bool visible) { m_is_visible = visible; } bool getVisible() { return m_is_visible; } diff --git a/src/Engine_Object.cc b/src/Engine_Object.cc index 68c8312..a8827c9 100644 --- a/src/Engine_Object.cc +++ b/src/Engine_Object.cc @@ -454,10 +454,10 @@ void Engine::Object::getPosition(double * x, double * y, double * z) *x = *y = *z = 0.0; } -void Engine::Object::loadPhy(FileLoader * fl, const FileLoader::Path & path) +void Engine::Object::loadPhy(unsigned char *data, unsigned int size) { m_phy = new PhyObj(); - m_phy->load(fl, path); + m_phy->load(data, size); if (!m_is_managed) instantiatePhy(); }