Bullet physics demo
Bullet physics demo
I've been messing around with Bullet physics for a while, and I'm very impressed with it. I started with ODE and found the Bounce tutorial invaluable, so I've put a Bullet-Irrlicht demo / framework together, which might be helpful to other people starting with Bullet.
No HTML yet, but I'll do a web page if anyone wants one.
Download
The demo loads various meshes and attaches them to different Bullet collision shapes, fairly simple stuff really, and demonstrates contact manifolds, compound objects, collision shape sharing etc. You can shoot the objects if you like that sort of thing (which I do) as a ray casting test. Should mention the camera uses a collision response animator, nothing to do with Bullet.
There is also a simple 'Hello World' application in there as well, see 'instructions.txt' for some info on compiling Bullet.
Sorry only Visual Studio project files supplied. I had to make a small X file patch to get the collision shapes working with X files, so I've included a prebuilt Irrlicht dll from SVN, with the patch.
I'm interested in any feedback, especially when things don't work, since I'm using Bullet in my next game.
No HTML yet, but I'll do a web page if anyone wants one.
Download
The demo loads various meshes and attaches them to different Bullet collision shapes, fairly simple stuff really, and demonstrates contact manifolds, compound objects, collision shape sharing etc. You can shoot the objects if you like that sort of thing (which I do) as a ray casting test. Should mention the camera uses a collision response animator, nothing to do with Bullet.
There is also a simple 'Hello World' application in there as well, see 'instructions.txt' for some info on compiling Bullet.
Sorry only Visual Studio project files supplied. I had to make a small X file patch to get the collision shapes working with X files, so I've included a prebuilt Irrlicht dll from SVN, with the patch.
I'm interested in any feedback, especially when things don't work, since I'm using Bullet in my next game.
Last edited by nomad on Sun Jan 20, 2008 1:44 pm, edited 1 time in total.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
Well, to be honest here - neither is Bullet's - although I personally prefer it at the moment. Once it's speed picks up a little - I think it will easily outclass ODE, but at the moment there is still some speed benefit in using Bullet's collision with ODE's constraint solver.Only use Bullet now, ODE's solver is not perfect.
Triangle Meshes: Not only does Bullet support tri-meshes & convex hulls, but you can also generate triangles on the fly for collision testing (say for parametric surfaces like bezier patches) and generate convex hulls from arbitrary meshes (using a tool in Bullet's "contrib" source directory).
Nice looking demo nomad. Have noticed you around the Bullet boards
--EK
Thanks, EK, glad you liked the demo
Yes ODE's solver is faster, I suppose it all comes down to what you want to do with the library. ODE won't handle a sphere rolling in a groove, Bullet does not like face-face collisions, ODE has some features Bullet lacks. But providing Erwin continues development, Bullet should win out in the end.
Yes ODE's solver is faster, I suppose it all comes down to what you want to do with the library. ODE won't handle a sphere rolling in a groove, Bullet does not like face-face collisions, ODE has some features Bullet lacks. But providing Erwin continues development, Bullet should win out in the end.
Very cool demo. Bullet is said to be the third best physics engine, it is develop by an ex Havok employee that had also worked with Phsyx source code for ps3, therefore it has lots of inspiration from trade secrets of the top gun commercial engines.
http://www.continuousphysics.com/Bullet ... .php?t=818
http://www.continuousphysics.com/Bullet ... .php?t=818
No question is already positioned as the third best engine.“As ex-Havok employee I can say they have a very fast and efficient sweep and prune implementation, and I added ray cast support in their sweep and prune. Although Bullet's sweep and prune is not bad either, there is some room for improvement indeed. It's just that in most scenes broadphase isn't the bottleneck, hence its popularity in general purpose physics engines like Havok, PhysX, Bullet and many 'in-house'/homebrew engines.”
Thanks for the feedback. I have to add about 200-400 objects to get the FPS below 15, but maybe that's just down to my graphics card. The framerate is VSYNCd so you probably won't get more than 60fps anyway, but I'm going to add some debug display options and time the physics / graphics CPU usage. Should be interesting to see the results.trunks14 wrote:i am getting low framerates, like 40.
I suppose I could add ODE for comparison, but the test's I've done don't show a huge difference between Bullet and ODE in performance, except in Debug builds.
What are your system specs, and how many objects do you add?
this is not a great system in fact (ATI Radeon 9550, AMD Athlon XP 2000+ [ye si know i need to get a newer one ], 256 MB RAM), but for what the demo does, i think it's fine, i checked again and it has good framerates of 55+, the problem is when i add spheres, maybe their geometry is much more complex?
Anyway nice demo, by the way, the movement is a lil bit slow, the map looks good, did you use Irredit, i like the shadow map
Anyway nice demo, by the way, the movement is a lil bit slow, the map looks good, did you use Irredit, i like the shadow map
Not yet.
Yes the spheres have a much larger poly count than the other objects (266 verts per sphere, 22 verts per cylinder) and they really do cut the framerate down.
The scene was done in MAX and exported as a MY3D file. OK for small scenes, but not much use for a large map. Also, I had to light the scene, then remove the statues before export - their poly count is just too high for collision detection.
I think I'll be using Irredit in future!
The scene was done in MAX and exported as a MY3D file. OK for small scenes, but not much use for a large map. Also, I had to light the scene, then remove the statues before export - their poly count is just too high for collision detection.
I think I'll be using Irredit in future!
Erwin Coumans (Bullet author) asked for some debug statistics like percentage CPU usage for Bullet. I've added a window with Bullet profiling data, using Bullet's really useful profiling class, btProfiler. Apart from that, it's the much the same as before, just a few graphical tweaks (wireframe, AABBs, object deactivation, nicer balls etc).
Worth a look if anyone was concerned about Bullet's performance in the original demo, which was slowed down in rendering by the large poly count in some of the objects (I had put a meshsmooth modifier on the balls, because I'm an idiot.)
This version is linked as multi-threaded, to match Bullet and avoid (possible) linker errors.
Download here
If anyone noticed some wierd flickering shadows, I have no idea why Irrlicht does this. Guess that's on my TODO list for 2007 (along with Bullet ragdolls perhaps)
Worth a look if anyone was concerned about Bullet's performance in the original demo, which was slowed down in rendering by the large poly count in some of the objects (I had put a meshsmooth modifier on the balls, because I'm an idiot.)
This version is linked as multi-threaded, to match Bullet and avoid (possible) linker errors.
Download here
If anyone noticed some wierd flickering shadows, I have no idea why Irrlicht does this. Guess that's on my TODO list for 2007 (along with Bullet ragdolls perhaps)
Last edited by nomad on Sun Jan 20, 2008 1:45 pm, edited 2 times in total.