May 2009 Archives

Box2d Example

| 0 Comments | 0 TrackBacks

This example is really only using Box2d for its collision detection and response - not so much the physics, as this is a top-down view. Actually, i am using it for quite a bit, but just not the normal kinds of things you might see with a physics demo!

I've implemented some basic "vision", so that the objects try to avoid each other. You can see the range of "vision" as the rectangles attached to the circles.

Check it out here.

I've been playing around with physics in flash for a while now. I've done some simple simulations myself, but those have mostly turned out to be sub-optimal. Recently i did a quick pass on the engines which are currently available for flash, and tried out a couple.

The one i kept coming back too was Box2d. It has a great community, both of flash users and the "main line" c++ version. The development is on-going, and there is a fair amount of documentation.

While the API is not super friendly, it has proven to do everything i've needed. Not always in the most straight forward fashion, but using google, the forum, wiki and manual, i've found answers to all my questions.

I can't say that about other physics packages. It is also quite fast, for a fair number of objects.

I'll be posting some demo and prototypes using this soon!