Is BulletPhysics C API fully functional?

ishutup
Posts: 2
Joined: Thu Mar 03, 2011 4:22 pm

Is BulletPhysics C API fully functional?

Post by ishutup »

Hi, there.
Our team are now working on a project that needs a lot of physics simulation (even more than in a big game),
and We decide to adapt BulletPhysics in our project.
For some weird reason, We have to use the BulletPhysics C-API exclusively.
Here's our problem : Is BulletPhysics C API fully functional for our usage OR We have to spend more time on wrap more functions in C API?


Thanks in advance.

Regards,
ishutup
EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Re: Is BulletPhysics C API fully functional?

Post by EnlightenedOne »

Bullet SDK - Is it functional? well for what purpose?
Collision detection of convex and other shapes? Yes.
Handling many objects in realtime? Yes if used properly.
Deforming and or shattering objects in to sub components? With the help of some external libraries I have seen implementations I am not sure on the extent to which it can do this independently.

Pros:
Highly portable - I have seen mention of Bullet ported to every device imaginable from ipads to playstation 3.
Modular components - You can remove components you do not depend on for your calculations when adding it to an application.
Dependencies - Bullet has no core external libraries it depends on to function, so long as you can use c++ you are ok.
Features - It has built in collision shapes for optimised interactions between objects based on user needs. This includes joints and support for cloth and rope deformables and a ray cast vehicle if you need to rapidly put together a decent car simulation.
Optimisation - Bullet can maintain a real time frame rate with many objects colliding at once and its pipeline allows for efficient removal of objects that are at a distance from one another (it uses broadphase and narrowphase collision detection).
Control - You can change the quality of the simulations precision with relative ease. Bullet will do all the hard work you want it to and give you control at whatever level you want it.
Threading - You can offload work to the GPU and multi thread the calculations to get massive ammount of objects colliding in real time.
Usage - Disney have used it for animation in the film Bolt so it must do something right!
Saving Data - Another benefit is that you can serialize an entire scenes physics data to a single .bullet file and reload an entire scene in one go.
Development - It is continuously being developed and improved by someone who is on occasion active in the forums so you have a good chance to bump into him eventually.

Cons:
Forums - This place moves quite slowly sometimes.
Bullet Tools - While there is a tool for viewing .bullet files there is no standardised means of exporting to .bullet format(there are many in development that are usable for Blender(you need to find a customised build available online), Maya (8+) and 3DSMax(9 and 11)).
Debugging - This is much more a caution than anything the default (and upgradable) collision debugger works using OpenGL in order to use DirectX with Bullet you need to find an existing function for converting from a bullet matrix to a D3DXMATRIX and also you need to write out in a provided space your draws for debug objects and parse them to DirectX.

Warning:
My major problem with the library is that the customised Blender exporter claims it is missing a file and while the patch data which can be compiled with Blender seperatetely is available I do not have a Linux distribution to compile it on. So that is a slightly worrying issue I have met. If you can crack getting bullet physics data parsed from your current models or loaded from seperate .bullet files you will be fine; I cannot get past that phase and you can see I am already sold on the SDK.

For more info:
Check the manual there are many resources after you get past loading in external Bullet collision shapes which will help you do whatever you want, I would say that the degree of interaction is quite flexible Bullet can do all the hard work for you if you want it to.
http://www.bulletphysics.com/ftp/pub/te ... Manual.pdf

You will probably need to observe the demos and prototype before you make a decision based on your needs if they are very demanding. I apologise in that I cannot provide more information I am still a begginner in using Bullet and your question is quite vague in scope.

Before you do any coding get your team to find a sample (I am afraid I cannot remember where I found it!) of bullet being multi-threaded over four threads with a ball rolling through a pyramid and about 6 or so stacks of cubes I was running it in disbelief at 10ms a frame there must have been a good 100-200 shapes colliding without any sign of my CPU sweating.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Is BulletPhysics C API fully functional?

Post by Erwin Coumans »

The Bullet C API lacks many features of the C++ API, so you will have to wrap it yourself. If you do so, please consider contributing it back, using this existing issue: http://code.google.com/p/bullet/issues/detail?id=43

@EnlightenedOne, I think the question refers to the C API, not C++.
You can load the missing DLL's from here:
http://code.google.com/p/bullet-physics ... 25dlls.zip
We will integrated .bullet file export into Blender 2.5 soon. Maya Dynamica plugin and Cinema 4D have .bullet export.

Thanks,
Erwin
EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Re: Is BulletPhysics C API fully functional?

Post by EnlightenedOne »

Fantastic, thank you so much for the zlib file!! I can confirm that exporting of .bullet files now definitely works, I will inform others who I have seen hitting problems with loading meshes if you have not posted on those threads already. I am very excited!

My apologies for misunderstanding this question!
ishutup
Posts: 2
Joined: Thu Mar 03, 2011 4:22 pm

Re: Is BulletPhysics C API fully functional?

Post by ishutup »

Thanks, pal.
Well, I am not sure whether We have enough time to make a complete wrapper( the project needs a rapid prototype ) ,however, if We do so , We will definitely put the C-API back here.

Regards,
ishutup