update loadPhy() interface

This commit is contained in:
Josh Holtrop 2011-05-19 22:59:04 -04:00
parent 08dbe60b7b
commit f1bc763be2
3 changed files with 7 additions and 4 deletions

View File

@ -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;
}

View File

@ -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; }

View File

@ -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();
}