clutter-box2d / moblin prototype

I have been creating an integration layer for using Box2d with Clutter (a low level toolkit using OpenGL). The API used is more inspired by the Box2D API than directly mirroring it since clutter-box2d aims to add physics directly to the sprites of Clutter instead of having the user maintain a separate physics world from the actual user interface, this mostly works very well; but some bits of Box2D are not exposed (sensors and collision callbacks), and other bits are not exposed since they can be changed at construction time only.

I've used this integration to create a UI concept prototype for the moblin project. This prototype features sliders with physics, scrollable views draggable with fingers and spinnable 2d-carousel menu backed by Box2D physics. It also features a sliding 15 puzzle with physics bugs (the pieces snag, and should have their corners rounded).

Image
Sliders sliding away after I stopped dragging them? You can't be serious 😕

Also those photos colliding at their edges look weird. Let them overlap a little. Use Box2D to prevent them from overlapping completely, but let them overlap. That would feel more natural, IMO.

I'd say turn damping way up to stop things sliding "forever". Keep things subtle. If there's a 5px slide that's enough to make the interface feel interactive or "fluid". Right now it seems I'd have to chase released items (esp caroussel and photos) across the whole screen 😉

Looks great, though!!
I agree that the interface needs more dampening, the problem with that is that I would have to introduce a default global dampening due to the strange way Box2D uses body-definitions to set initial properties and doesn't (yet) have setter/getter APIs to manipulate these and other properties.

The horizontal sliders are a very quick hack to show that it is possible to dictate all of the behavior of user interface components with a rather fully fledged physics engine. In the roadmap of Box2D there are bits about friction for top-down-games, such functionality would be useful in future experiments.

Original thread: https://box2d.org/forum/viewtopic.php?t=1244