I’m trying to build a SliderJoint that’s constrained to the Y axis(vertical).
I use the SliderJoint class and it’s constructor; supplying it the respective controls, their local pivot points and useLinearReferenceFrameA boolean.
The joint gets created but it’s constraint is in the horizontal direction.
I don’t understand how to change the direction of constraint. None of the class methods seem to do so.
I try supplying the alternative constructor with two Matrix3f rotation matrices but that doesn’t change the direction of the slider but rotates the bodies instead.
The documentation is sketchy. Here’s what I think:
setLinearLowerLimit(), setAngularUpperLimit(), and so on alter the limits of the joint axes (x, y, and z). To emulate a slider joint on the Y axis, I suggest setting the X and Z limits to 0. Lowerlimit = Upperlimit causes an axis to be locked. If you want limits on the Y axis, you can specify those; just make sure upper > lower. Or you can set upper < lower, which will cause the axis to be “free” or unconstrained.
Are those the Vector3f arguments you’re asking about?
I often find that making a debug state with a gui saves from reloading every 30 seconds just to change a few variables. The lemur gui library makes it very simple to make one. You can add sliders or text inputs and bind them using a property panel (I think the property panel is in lemur-Proto). Making these is generally one of those things you get used to doing as time goes by.