Prismatic Joints

I'm not quite sure how they work...

From what I understand, it allows translation along a single axis, but how do you specify that axis? What's it's directional vector? I don't quite get how the anchor point works... it makes sense for revolute joints, and distance joints...

Also, from what I understand, the "motorForce" is actually a maximum force, and by setting the motor speed it will apply up to that maximal force in order to maintain the specified speed. Is speed as in velocity, or acceleration? And again, what direction? (Does it oscillate between lower translation and upper translation?) And "enableLimit" .. if it's true, does that mean my objects are constrained by the lower and upper translations, or that the joint will snap if it exceeds said values?

Thanks.
You can see an example of a prismatic joint in the Motors and Limits test. b2PrismaticJointDef has an axis member that specifies the direction of motion. You are correct about the motor force being the maximum. Speed is the signed magnitude of the velocity along the joint axis. Joint limits prevent motion outside that range. If the joint exceeds the range, the joint will exert an unbounded force to move the joint back into range.

I suggest playing around with the test-bed examples to get a feeling for how the various joints work.
Oh! There *is* an axis attribute! I guess I should have looked harder. You might want to include that in your user manual 😉 The example you give doesn't show it.

This suddenly makes a lot more sense now 🙂

Thank you!

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