I am trying to give back and forth motion of a body connected via revolute joint. I was trying to set reference to zero, when simulation starts 45 degree in clockwise then in anticlockwise back to reference and 45 degree anticlockwise from reference. i want Click the imgage,in which 0 is reference the 45 degre to 1,45 degree back i.e 2,then 45deg clockwise and then back to reference I tried this
RevoluteJointDef revoluteJointDef = new RevoluteJointDef();
revoluteJointDef.initialize(ballBody,rectBody,new Vector2(25,30));
revoluteJointDef.lowerAngle=0.785f;
revoluteJointDef.upperAngle=0.785f;
revoluteJointDef.localAnchorA.set(25,30);
revoluteJointDef.enableMotor=true;
revoluteJointDef.enableLimit=true;
revoluteJointDef.maxMotorTorque=1000f;
revoluteJointDef.motorSpeed=12.6f;
revoluteJointDef.referenceAngle=0f;