On Mon, 2008-08-11 at 11:32 +0100, Øyvind Kolås wrote:
> 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.

Many thanks for thinking about it. But I guess this would be a rather
inefficient way of getting this behaviour, as well as being lengthy to
implement.

I guess this is something that could be abstracted outside of
clutter-box2d, though it would be nice to still use the hitting and
damping stuff from clutter-box22d.


-- 
[EMAIL PROTECTED]
www.murrayc.com
www.openismus.com

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to