Bullet as a shared library would downgrade performance?

abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Bullet as a shared library would downgrade performance?

Post by abaraba »

hi,

- i dont know about Jam and cMake, so can someone hint are there any options and how difficult would be to build Bullet as a shared library and would that impact performance?

- what are the benefits/reasons for Bullet being in static libs?


cheers
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bullet as a shared library would downgrade performance?

Post by Erwin Coumans »

By default, Bullet is a static library and not a system-wide library, a few reasons are:
  • it makes it easier for several applications/games to use their own version of Bullet
  • simulation behaviour tends to change between versions of Bullet, and many games/applications won't benefit of such change
  • static linkage makes it harder to 'cheat' by simply replacing the dll
  • some of the Bullet target platforms don't support dynamic/shared libraries
Still, if you insist, you can create a shared library yourself, it is open source after all.
Hope this helps,
Erwin
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: Bullet as a shared library would downgrade performance?

Post by abaraba »

it helps, thanks!

i actually got surprised when thought about it a bit more and apparently it is specific to physics library - while in the case of graphics or audio you always benefit with the improvement of drivers and libraries, eg. faster frame rates, enabled new features already present in application... with shared physics library, even tho new version is "more realistic", suddenly you character might not be able to reach that platform...


i was interested in performance as i was thinking something among these lines: -man, how cool would it be to integrate OpenGL, OpenAL and Bullet Physics and wrap it all with something like SDL/GLUT under same API, so call to something like glbtCube(size,mass,.. ), or similar call to display_list could setup rigid body for you as well... tho, i wouldn't think there is any speed difference between static and shared libs, while investigating pros and cons... they mention something around 5% speed increase with static libs

thanks for making Bullet Open Source,
i mean, you wrote 70% of my game for me and probably around 50% or so of any other game out there that uses it... it's the next best thing after OpenGL ..and yoghurt