Slider Joint Constraint Axis

Hello,

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.

Any help would be appreciated.

1 Like

I’m looking into this, but I suspect this may be a built-in limitation of the SliderJoint class.

Could you use a SixDofJoint and disable the other 4 degrees of freedom?

It seems to be a limitation of the underlying software:
btSliderConstraint - Real-Time Physics Simulation Forum

Let me know whether SixDofJoint meets your needs or not.

1 Like

Thanks for the prompt reply Sir!

I’m able to create the SixDofJoint. I am able to place rotational constraints using the Class methods. The linear constraints are making the run unstable.

Can you please clarify the usage of the setLinearLowerLimit, setAngularLowerLimit and their respective counterparts? Also please explain how the Vector3f argument works exactly?

1 Like

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?

1 Like

Yes I was asking exactly what you told.
Although due to the lack of proper docs it’s pretty tough to get a stable run.

I have resorted to trial and error of the tuning parameters which is causing a lot more headache than it should but I will hopefully make it work.

On a side note, can we update the javadoc for future developers who might get stuck? I will be happy to contribute.

Thanks for all the help!

1 Like

I’ve despaired of getting the website updated:
https://javadoc.jmonkeyengine.org/

However, we can easily update the javadoc in the source code. The preferred route would be a pull request to:
GitHub - jMonkeyEngine/jmonkeyengine: A complete 3D game development suite written purely in Java. (for jme3-bullet and/or jme3-jbullet)
and/or
GitHub - stephengold/Minie: Integrate Bullet Physics and V-HACD into jMonkeyEngine projects. (code has New BSD license) (for Minie)

I look forward to your contributions!

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.

Actually, it’s a separate thing: lemur-props Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog