(JM3) Physics6DofJoint doubt

With a Physics6DofJoint is possible to translate the 'Y' or 'Z' axis?

I ask this because with getRotationalLimitMotor(int index) I can select one of the three rotational motors but with with getTranslationalLimitMotor() i can

You could connect the joint and then rotate the whole PhysicsNode.



Rotate the PhysicsNode?

I create a Physics6DofJoint:

        driver=new PhysicsNode(new BoxCollisionShape(new Vector3f(0.2f,.5f,0.2f)),3);
        Vector3f lowerSliderLimit = new Vector3f(0,0,-1);
        Vector3f hiSliderLimit = new Vector3f(0,0,1);
        boolean useLinearReferenceFrameA = true;//use fixed frame B for linear limits
        slider2 =new Physics6DofJoint(
                 driver,vehicle,new Vector3f(0f,-1f,0f) ,new Vector3f(0,1f,0f),useLinearReferenceFrameA);
        slider2.setAngularLowerLimit(new Vector3f(0,0,0));
        slider2.setAngularUpperLimit(new Vector3f(0,0,0));

And I try to move :

if (binding.equals("Ups")) {
            driver.setLocalTranslation(0, 0, -1);
            driver.setLinearVelocity(new Vector3f(0,0,-0.1f));

But the driver physicsNode move very fast (ignores the setLinealVelocity). Can I control the velocity if I move the joint in this way? Is correct move the slider in 'Z' axis in this way?

The slider has no velocity, it only has damping and motors. The setLinearVelocity is applied to the physicsNode once, its like giving it a kick, not a "maximum speed". So if you want to move the slider, you should use the translational motor for that.

But with getTranslationalLimitMotor() i can

The axis is defined by what you said, the vectors. The damping values can make the axis move "slower" and you are right, theres no motor for that. So yes, we are back again. If you take a PhysicsNode, attach a slider joint to it so that it points in the x-direction and then rotate the PhysicsNode so that the slider points to the y-axis you have what you want.



Ah ok, I did not understand the idea of rotate a slider joint, was obsessed with Physics6DofJoint.

Thank you very much you just solved a problem that made me rethink again the implementation of ODE.