I am attempting to load the model I have built using Blender 2.63.0 r46461 from which I have successfully exported a 22KB .bullet file. I have adapted the serialize demo supplied with bullet 2.80-rev2531 with the following code.
Code: Select all
void SerializeKuka::initPhysics()
{
char* fileName = "kuka.bullet";
setTexturing(true);
setShadows(true);
setCameraDistance(btScalar(SCALING*30.));
setupEmptyDynamicsWorld();
m_fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(fileName);
//bulletFile2->parse(true);
bulletFile2->parseData();
m_fileLoader->setVerboseMode(true);
if(!m_fileLoader->loadFileFromMemory(bulletFile2))
{
std::cout << "Failed to load file: " << fileName << std::endl;
return;
}
/*
if (!m_fileLoader->loadFile(fileName))
{
std::cout << "Failed to load file: " << fileName << std::endl;
return;
}
*/
std::cout << "Looking for bodies:\n Found "<< m_dynamicsWorld->getNumCollisionObjects() << " objects." << std::endl;
for(int numBodies = 0; numBodies < m_dynamicsWorld->getNumCollisionObjects(); numBodies++)
{
btCollisionObject* Body = m_dynamicsWorld->getCollisionObjectArray()[numBodies];
const char* name = Body->getCollisionShape()->getName() ;
std::cout << "found body " << name << std::endl;
}
//clientResetScene();
}
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0x00000000004f6042 in bParse::bFile::getNextBlock(bParse::bChunkInd*, char const*, int) ()
Code: Select all
(gdb) bt
#0 0x000000389e5380f0 in __memcpy_ssse3 () from /lib64/libc.so.6
#1 0x000000000052e59b in bParse::bFile::getNextBlock (this=0x8e42b0,
dataChunk=0x7fffffffd5d0, dataPtr=0xc <Address 0xc out of bounds>, flags=0)
at /media/B0FC-7F98/bullet-2.80-rev2531/Extras/Serialize/BulletFileLoader/bFile.cpp:1265
#2 0x00000000005302ab in bParse::btBulletFile::parseData (this=0x8e42b0)
at /media/B0FC-7F98/bullet-2.80-rev2531/Extras/Serialize/BulletFileLoader/btBulletFile.cpp:135
#3 0x00000000004754f4 in SerializeKuka::initPhysics (this=0x7fffffffd720)
at /media/B0FC-7F98/bullet-2.80-rev2531/Demos/SerializeKuka/SerializeKuka.cpp:162
#4 0x000000000046c2e9 in main (argc=1, argv=0x7fffffffd948)
at /media/B0FC-7F98/bullet-2.80-rev2531/Demos/SerializeKuka/main.cpp:32