0
\$\begingroup\$

I have a revolute joint set up as such in libgdx + box2d:

            RevoluteJointDef rjd = new RevoluteJointDef();
        rjd.initialize(body1, body2, arm.getWorldCenter());
        rjd.motorSpeed = 100.0f;
        rjd.enableLimit = false;
        rjd.enableMotor = true;
        rjd.collideConnected = false;
        world.createJoint(rjd);

The joint displays and connects fine, but it never seems to turn or rotate. After some googling some people said to increase the motor speed, but I've turned that up to ridiculous values with still no rotations. The density of both body1 & body2 are set to 1.0f, so I'm not sure what else to do (both bodies are dynamic).

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I think you might need to set the value of the maxMotorTorque field. Here's an example of how different values enable the motor joint to function correctly.

\$\endgroup\$
1
  • \$\begingroup\$ Wow, that was it, I had assumed there just would be no max if I didn't set it. Thanks! \$\endgroup\$
    – Jimmt
    May 25, 2014 at 3:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .