[Solved] Combine b2RevoluteJoint and b2PrismaticJoint

I've tried to use two different joints together without result. The two I want to combine are b2RevoluteJoint and b2PrismaticJoint.

The thing I want to create is a pad which should be able to rotate around its origin. But it should be limited (if wanted) like the b2RevoluteJoint is. Additionally, it should be able to move back and forth on a line, like with the b2PrismaticJoint. The last requirement is that one side of this joint should be static (not be able to move) and the other one dynamic.

I've tried the following combinations (and others) without successful results:

static <-b2PrismaticJoint-> dynamic <-b2RevoluteJoint-> dynamic (everything moves, not static anchor/base)
static <-b2PrismaticJoint-> kinematic <-b2RevoluteJoint-> dynamic (only rotation works)
static <-b2PrismaticJoint-> static <-b2RevoluteJoint-> dynamic (only rotation works)
static <-b2RevoluteJoint-> dynamic <-b2PrismaticJoint-> dynamic (everything moves, not static anchor/base)
static <-b2RevoluteJoint-> kinematic <-b2PrismaticJoint-> dynamic (only sliding works)
static <-b2RevoluteJoint-> static <-b2PrismaticJoint-> dynamic (only sliding works)

The image demonstrates the idea. Black is the dynamic body. Green is the span of the revolute joint. Blue is the span of the prismatic joint. And everything should be anchored to the ground (a static body)

Attachment:
newjoint.png
newjoint.png [ 3.48 KiB | Viewed 378 times ]


How should I solve this? What should I use as "glue" between two joints? Or should I develop my own joint and commit to the project?
Did you look at the Line joint?
Hi! Thanks for the quick reply!

I did some testings with it before, but didn't manage to get it work properly. But now it seems to be working(!) as intended, thanks! The problem I had before with the line joint, was that the line was changed according to its rotation, like the ship in the old asteroids game. Probably this was due to some forces I applied somewhere else, I don't know...

What is the best "glue" between two joints? Should I just use a dummy body, or is there any object specific for this?
Creating dummy bodies is sometimes done. You have to make sure the dummy body has significant mass.

It is better to merge the two joints into a single joint type. It sounds like the line joint will work for you, so this has already happened.
Ok, thanks for the info!

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