update loadPhy() interface
This commit is contained in:
parent
08dbe60b7b
commit
f1bc763be2
@ -604,7 +604,10 @@ int Engine::loadModel(const string & name, bool is_static, bool is_reference,
|
|||||||
Engine::Object * engine_obj = getObject(id);
|
Engine::Object * engine_obj = getObject(id);
|
||||||
if (engine_obj != NULL)
|
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;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class Engine
|
|||||||
|
|
||||||
void setPosition(double x, double y, double z);
|
void setPosition(double x, double y, double z);
|
||||||
void getPosition(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 instantiatePhy();
|
||||||
void setVisible(bool visible) { m_is_visible = visible; }
|
void setVisible(bool visible) { m_is_visible = visible; }
|
||||||
bool getVisible() { return m_is_visible; }
|
bool getVisible() { return m_is_visible; }
|
||||||
|
@ -454,10 +454,10 @@ void Engine::Object::getPosition(double * x, double * y, double * z)
|
|||||||
*x = *y = *z = 0.0;
|
*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 = new PhyObj();
|
||||||
m_phy->load(fl, path);
|
m_phy->load(data, size);
|
||||||
if (!m_is_managed)
|
if (!m_is_managed)
|
||||||
instantiatePhy();
|
instantiatePhy();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user