sampad1370 / box2d

Automatically exported from code.google.com/p/box2d
0 stars 0 forks source link

Feature Request: a "Stick-to-wall" joint #270

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to have a joint that is like a revolute joint and a prismatic 
joint combined.  So the object stays on an axis, but the relative rotation may 
be able to change.  Also it would be nice to set the limits on the constrained 
axis, I would like to use a joint like this to Stick objects to each other, but 
be able to have them move along a wall.  The prismatic joint almost already 
works, it has one problem that it cancels out impulses towards the wall, I only 
want to cancel out forces going away from the wall.  Also it doesn't allow 
relative rotation.

To use the joint this way you would also have to be able to reset the body its 
connected to, and the axis of the prismatic joint every frame, based on the 
closest wall after the integration.

I discuss it a bit more on this thread:

http://box2d.org/forum/viewtopic.php?f=3&t=8156

I got the idea from this thread (only mine uses a prismatic joint, and slides 
instead of rolls):

http://farseerphysics.codeplex.com/discussions/244934

And a video demonstration of this technique:

http://www.youtube.com/watch?v=I_eRFmT4PSk

Original issue reported on code.google.com by eatja...@gmail.com on 18 Mar 2012 at 1:22

GoogleCodeExporter commented 9 years ago
I replied to your post. I don't think you need a joint for this.

Original comment by erinca...@gmail.com on 18 Mar 2012 at 6:10

GoogleCodeExporter commented 9 years ago
We discussed this on the forums and eatjason will do some more experiments.

Original comment by erinca...@gmail.com on 20 Mar 2012 at 5:15