Page 1 of 1

Possible problem with deserialization of triangle meshes

Posted: Sat Sep 04, 2010 12:10 pm
by LtJax
Hello,

I was having problems with btBulletWorldImporter and importing triangle mesh shapes from .bullet files. I was using pretty much the same code that Erwin posted in this thread. However, anytime I entered a narrow phase collision with such a mesh, bullet would crash.
After some investigation, it seems like the world importer never copies the actual triangle data into the triangle mesh. The triangle data is just type-casted from the data chunk in the btBulletFile. However, btBulletWorldImporter deletes the bullet file after parsing in btBulletWorldImporter::loadFile, also invalidating the triangle, and more importantly, the index data.
So I switched to using btBulletWorldImporter::loadFileFromMemory, kept the bullet file around and it now works just as expected.
Is this indeed a problem or did I just misunderstand the code?

Regards,
Marius

Re: Possible problem with deserialization of triangle meshes

Posted: Wed Oct 27, 2010 6:17 am
by sonofrage
Thanks for the post dude. I had the same exact problem and used your fix to solve it.

Re: Possible problem with deserialization of triangle meshes

Posted: Sat Jan 22, 2011 2:38 am
by VicariousEnt
I just posted a proper fix for this here...
http://bulletphysics.org/Bullet/phpBB3/ ... 843#p21843

Re: Possible problem with deserialization of triangle meshes

Posted: Tue Jun 25, 2013 10:27 pm
by rraallvv
Is this fixed in the latest stable release?

Re: Possible problem with deserialization of triangle meshes

Posted: Fri Jul 19, 2013 1:44 am
by VicariousEnt
yup