Java 直线接头加速轮

Java 直线接头加速轮,java,box2d,Java,Box2d,我使用box2d直线接头模拟带悬架的车轮,但我无法正确加速 我的联合守则: LineJointDef fJointDef = new LineJointDef(); fJointDef.initialize(mainBody, wheelBody, wheelBody.getWorldCenter(), new Vector2(0,-1)); fJointDef.enableMotor = true; fJointDef.u

我使用box2d直线接头模拟带悬架的车轮,但我无法正确加速

我的联合守则:

            LineJointDef fJointDef = new LineJointDef();
        fJointDef.initialize(mainBody, wheelBody, wheelBody.getWorldCenter(), new Vector2(0,-1));
        fJointDef.enableMotor = true;
        fJointDef.upperTranslation = 0.10f;
        fJointDef.lowerTranslation = -0.10f;
        fJointDef.enableLimit = true;
        fJointDef.motorSpeed = 10;
        fJointDef.maxMotorForce = 30f;
悬架工作,车轮正确地连接到车身,它可能会移动等等,现在我真的不知道如何正确地移动它,编辑直线接头的电机速度和最大电机力没有任何作用。最后,我对轮体施加了角脉冲:

wheelBody.applyAngularImpulse(5 * direction);
但有了这个,车辆可能会以无限的速度移动,如果有人能提供一些帮助,我们将不胜感激,谢谢