Movement of body after applying weld joint

Posted by ved on Game Development See other posts from Game Development or by ved
Published on 2013-10-22T18:59:40Z Indexed on 2013/10/22 22:04 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

I have two rectangular bodies. I've applied Weldjoint successfully on these bodies. I want to move that joined body by applying linear impulse. After weld joint, these two bodies becomes single body right? How do I apply force/impulse on the joined body?

I am using Box2D with LibGDX.

I've tried this:

polygon1.applyLinearImpulse(new Vector2(-5, 0), polygon1.getWorldCenter(), true);

I thought that if I move polygon1 then polygon2 will also move due to my weld joint but it is not working properly.

Why don't they move together after being welded?

© Game Development or respective owner

Related posts about java

Related posts about box2d