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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user