SLRBS demo
February 11th, 2009

Here’s a demo of the auto-gen physics engine (SLRBS- Super Lightweight Rigid Body Simulator) I’ve been working on which allows you to select images to use as rigid bodies. First, the image is analyzed, ignoring transparent pixels, to determine its convex hull. Then mass/center of mass/inertia tensor are solved for. Finally, the rigid body is created and dropped into the world.
I’m sure that in playing with it, you’ll notice all sorts of wonky behavior… but I think it’s fun anyway. Let me know if there’s a class or type of shape/image that tends to be particularly misbehaved!
ActionScript 3.0, Flash Player 10, Geometry, Mathematics, Physics
Very nice, im really interested in yoru convex-shape-extracting method.
Also: I couldn’t wait to try the demo, but the Add File dialogue wont let me select images (not my own, nor those in your pack). Im on Windows XP, FP10(debug), it looks like the file-type filer blocks my images from showing up in the file browser (it says ‘image formats’ in the selector, but it doesnt seem to include png/jpg).
Absolutely amazing :O :O
@Macaca
I’ll be covering the image analysis in a post when I release the geometry library in the near future, but it goes something like this:
1. Take an IBitmapDrawable and draw it into BitmapData
2. Find the convex hull using Andrew’s Algorithm
3. Determine (read: guess) whether the shape is a circle. If so, find center and radius and exit algorithm.
4. Reduce convex set returned from Andrew’s Algorithm. You can get a shitload of points that represent the convex hull and ideally you want as few as possible. This is a finicky process, with a few algorithms involved, but I’m fairly happy with the result as they’re all based on intuition.
5. Assign geometry- if there are 2 or 3 points, it’s a line segment or triangle, respectively. Otherwise it’s a convex polygon.
I put up a swf without the filter here- hope that works!: http://lab.generalrelativity.org/glib/SLRBS/autoGen/autoAdd/noFilter/
What are the chances of making this work for top-down style games? I’m working on something where i need collision stuff, but its not a side-view kind of thing…
@jos
All forces, gravity included, get added modularly per the developer’s discretion, so there should be no difference in the eyes of the physics simulation between top-down and side-scrolling.
Excellent. Looking forward to checking out your library when you release it. Thanks for the hard work and making it public.
Do you have a date or month it will be released?? How far have the development come? Im realy looking forward to use this in my current game.
Keep up your excellent work.
Btw FOAM don’t suck:D
Hi,
Does this work is still in progress? Have you done a first release?
Thanks for all your great jobs!
Cheers!
Unfortunately I never continued work on SLRBS or my geometry library. Maybe someday I’ll get back to it just to get it to a state worth sharing.