minor tweak: allow btBulletWorldImporter to convertAllObjects (instantiate Bullet objects) without having to reload/parse the .bullet file. Can be useful to quickly destroy and restart a dynamics world

This commit is contained in:
erwin.coumans
2010-05-03 19:49:46 +00:00
parent 8723005cd7
commit c35e72bd9f
2 changed files with 11 additions and 3 deletions

View File

@@ -456,11 +456,8 @@ char* btBulletWorldImporter::duplicateName(const char* name)
return 0;
}
bool btBulletWorldImporter::loadFileFromMemory( bParse::btBulletFile* bulletFile2)
{
int i;
bool ok = (bulletFile2->getFlags()& bParse::FD_OK)!=0;
if (ok)
@@ -473,6 +470,14 @@ bool btBulletWorldImporter::loadFileFromMemory( bParse::btBulletFile* bulletFil
bulletFile2->dumpChunks(bulletFile2->getFileDNA());
}
convertAllObjects(bulletFile2);
}
bool btBulletWorldImporter::convertAllObjects( bParse::btBulletFile* bulletFile2)
{
int i;
for (i=0;i<bulletFile2->m_bvhs.size();i++)
{
btOptimizedBvh* bvh = createOptimizedBvh();

View File

@@ -105,6 +105,9 @@ public:
bool loadFileFromMemory(bParse::btBulletFile* file);
//call make sure bulletFile2 has been parsed, either using btBulletFile::parse or btBulletWorldImporter::loadFileFromMemory
bool convertAllObjects(bParse::btBulletFile* file);
void setVerboseMode(bool verboseDumpAllTypes)
{
m_verboseDumpAllTypes = verboseDumpAllTypes;