On Mon, Aug 11, 2008 at 11:03 AM, Murray Cumming <[EMAIL PROTECTED]> wrote:
> I have sometimes thought that it would be a nice abstraction to put an
> actor on a rail and let the user move it along that rail.
>
> Does clutter-box2d offer anything like that, or could it?

There are multiple ways you could do this. By creating some actors in
a box2d group that will not be visualized but only used for the
physics simulation. The elastomanic approach would be to create a
railing and then a "wagon" that drives the rail with wheels/sledges on
both sides of the railing that are held together by an elastic joint
making it snugly hug the railing. Ideally you probably would want to
use circular shapes for wheels, but ClutterBox2d is currently only
mirroring the bounding boxes of actors making you have to stick with
rectangles for now.

        ___               _____
       |   |                |
 |     |_|_|                |
 |=======|=======\          |
 |     | | |      \         |
       |___|       \       /
                    \_____/


It would also be possible to do it with only one wheel, where you
create a hollow railing.

For both of these you might have to do some additional tweaking of how
the pointer events manipulate the actors since you might want a larger
grabbable region than the underlying mechanics would provide. Note
that all of this mechanics might be placed in actors that are
hidden/have 0 opacity.

/Øyvind K.
-- 
«The future is already here. It's just not very evenly distributed»
 -- William Gibson
http://pippin.gimp.org/ http://ffii.org/
--
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to