Bullet physics demo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Bullet physics demo

Post by nomad »

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.

Image


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.
kornerr
Posts: 245
Joined: Thu Jul 06, 2006 9:57 am
Location: Russia, Siberia, Kemerovo
Contact:

Post by kornerr »

you use ode or bullet only?
and no triangle meshes?
Open Source all the way, baby ;)
OSRPG
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

kornerr wrote:you use ode or bullet only?
Only use Bullet now, ODE's solver is not perfect.
kornerr wrote:and no triangle meshes?
Bullet supports triangle meshes as btTriangleMeshShape and btBvhTriangleMeshShape (optimized), also convex hulls. I use btBvhTriangleMeshShape for terrain.
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

Only use Bullet now, ODE's solver is not perfect.
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.

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
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

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.
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

Hmm... I guess I should have put some instructions in the original post - they are in readme.txt, but just hit 1-6 to add objects, and shoot to remove objects. :?
trunks14
Posts: 45
Joined: Fri Dec 17, 2004 7:30 am
Location: America

Post by trunks14 »

i am getting low framerates, like 40.
Not yet.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

How many objects have you created, or is that the base frame rate with no objects? I created around 200 objects and that completely killed the frame rate down to about one frame a second but it was fine other than that!
Image Image Image
cassini
Posts: 68
Joined: Thu May 12, 2005 2:40 pm

Post by cassini »

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
“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.”
No question is already positioned as the third best engine.
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

trunks14 wrote:i am getting low framerates, like 40.
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.
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?
cassini
Posts: 68
Joined: Thu May 12, 2005 2:40 pm

Post by cassini »

Is probably bounded by the graphics card, In my Athlon 64 with a g6600 I can go over 350 cylinders before start to drop bellow 59 fps.
trunks14
Posts: 45
Joined: Fri Dec 17, 2004 7:30 am
Location: America

Post by trunks14 »

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 :P], 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 :)
Not yet.
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

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!
nomad
Posts: 53
Joined: Thu Jan 05, 2006 12:35 pm
Location: Wales

Post by nomad »

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)
Last edited by nomad on Sun Jan 20, 2008 1:45 pm, edited 2 times in total.
Jacob_x
Posts: 4
Joined: Fri Jan 26, 2007 8:33 pm

Post by Jacob_x »

Is it possible to integrate Bullet with Irrlicht in Dev-Cpp or Code::Blocks?
Post Reply