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
Possible problem with deserialization of triangle meshes
-
- Posts: 8
- Joined: Thu Sep 18, 2008 2:37 pm
-
- Posts: 3
- Joined: Sat Oct 23, 2010 9:52 am
Re: Possible problem with deserialization of triangle meshes
Thanks for the post dude. I had the same exact problem and used your fix to solve it.
-
- Posts: 50
- Joined: Fri Oct 29, 2010 1:37 am
Re: Possible problem with deserialization of triangle meshes
I just posted a proper fix for this here...
http://bulletphysics.org/Bullet/phpBB3/ ... 843#p21843
http://bulletphysics.org/Bullet/phpBB3/ ... 843#p21843
-
- Posts: 30
- Joined: Thu Feb 09, 2012 2:39 am
Re: Possible problem with deserialization of triangle meshes
Is this fixed in the latest stable release?
-
- Posts: 50
- Joined: Fri Oct 29, 2010 1:37 am