Possible problem with deserialization of triangle meshes

Post Reply
LtJax
Posts: 8
Joined: Thu Sep 18, 2008 2:37 pm

Possible problem with deserialization of triangle meshes

Post by LtJax » Sat Sep 04, 2010 12:10 pm

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

sonofrage
Posts: 3
Joined: Sat Oct 23, 2010 9:52 am

Re: Possible problem with deserialization of triangle meshes

Post by sonofrage » Wed Oct 27, 2010 6:17 am

Thanks for the post dude. I had the same exact problem and used your fix to solve it.

VicariousEnt
Posts: 50
Joined: Fri Oct 29, 2010 1:37 am

Re: Possible problem with deserialization of triangle meshes

Post by VicariousEnt » Sat Jan 22, 2011 2:38 am

I just posted a proper fix for this here...
http://bulletphysics.org/Bullet/phpBB3/ ... 843#p21843

rraallvv
Posts: 30
Joined: Thu Feb 09, 2012 2:39 am

Re: Possible problem with deserialization of triangle meshes

Post by rraallvv » Tue Jun 25, 2013 10:27 pm

Is this fixed in the latest stable release?

VicariousEnt
Posts: 50
Joined: Fri Oct 29, 2010 1:37 am

Re: Possible problem with deserialization of triangle meshes

Post by VicariousEnt » Fri Jul 19, 2013 1:44 am

yup

Post Reply