Disable bullet serializer

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
simulacrum
Posts: 5
Joined: Sat Nov 27, 2010 2:01 am

Disable bullet serializer

Post by simulacrum »

Hello,

Im using bullet with my own cmakefiles derived from the original ones but the serializer wouldn't compile on win7 64, most likely due to my own fault. Since I wont be needing the embedded serializer i decided to #ifdef serialization and their data structures out.
Disabling the serializer doesn't really save much. Performance is the same and the compiled library files are only marginally smaller. But if anyone else wants to disable it, whether because they dont need it or provide their own physics format, then using the patch below on the released 2.77 sources should add an option in the cmake configuration to disable the serializer.

Patch tested on 64 bit linux without demos and extras enabled.

(since a cant attach .patch or .txt files i had to zip it up)
You do not have the required permissions to view the files attached to this post.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Disable bullet serializer

Post by Erwin Coumans »

It would be good to fix your compile problems. Can you provide the errors?

Thanks,
Erwin
simulacrum
Posts: 5
Joined: Sat Nov 27, 2010 2:01 am

Re: Disable bullet serializer

Post by simulacrum »

no problem.
its the same as the problem mentioned here: http://bulletphysics.org/Bullet/phpBB3/ ... +precision

compiling under a 64bit platform works fine but when using mingw-w64 there are 'precision errors' due to line 69 of btAlignedAllocator.cpp:

Code: Select all

(alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
and elsewhere in the code (such as btSerializer)

the problem is that the width of 'long' is 32bits under mingw-w64 whereas most of the time its 64bits which is why it compiles fine everywhere else. Since pointers are 64bits wide casting real + sizeof(void*) can easily go over the unsinged long width in mingw-w64, hence the error.

In short its easily fixed by replacing 'unsigned long' with 'uintptr_t' under systems that provide stdint.h which windows doesnt so win64 needs ULONG_PTR instead. I've already changed it with the necessary #ifdef's getting the system values from cmake and it compiles without problem on mingw-w64, vs2008, and gcc 4.4 under linux.

i should have a patch ready sometime today for the 2.77 release. i'll checkout the latest dev version too, though i dont know if this was fixed already.

hope this helps.
goran
simulacrum
Posts: 5
Joined: Sat Nov 27, 2010 2:01 am

Re: Disable bullet serializer

Post by simulacrum »

i created a new thread for the mingw-w64 patch which also has a patch to fix compilation issues on linux.

http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=6045