RevoluteJoint Stop Rotating when Some Physics Body Collide in Andengine + Box2d?
Posted
by
Nikhil Lamba
on Game Development
See other posts from Game Development
or by Nikhil Lamba
Published on 2012-06-18T12:29:27Z
Indexed on
2012/06/18
15:25 UTC
Read the original article
Hit count: 634
I am making a Game from andengine + box2d in Which i am using RevoluteJoint in that case i am facing some problem that when physics body or Sprite Collide with this Revolute joint body then Revolute body stop rotating then after some time it start rotating I am using below code for this :
this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(movingFace, movingBody, true, true));
final RevoluteJointDef revoluteJointDef = new RevoluteJointDef();
revoluteJointDef.initialize(anchorBody, movingBody, anchorBody.getWorldCenter());
revoluteJointDef.enableMotor = true;
revoluteJointDef.motorSpeed = 100;
revoluteJointDef.maxMotorTorque = 200;
this.mPhysicsWorld.createJoint(revoluteJointDef);
EDIT Here is a screenshot:
© Game Development or respective owner