Interpenetration Box2d

Anything libgdx related goes here!

Interpenetration Box2d

Postby carisma_fe » Thu May 31, 2012 10:40 pm

Hi I've a problem using box2d. I made a world with 3 bodies, 2 of which are dynamic (a CircleShape and a PolygonShape) and the third is a static platform (ChainShape), I've disposed these object in the world as showed in the picture just below.

Image

The problem is that the ball interacts well with the platform, while the box interpenetrates as showed in the next picture.

Image

I've tried to add some point in the chainshape just below the box, where the problem happens, and it looks fixed,
but is there an explanation for that?

Thanks a lot for any answer.
carisma_fe
 
Posts: 4
Joined: Thu May 31, 2012 10:06 pm

Re: Interpenetration Box2d

Postby Semtiko » Thu May 31, 2012 11:02 pm

Hi! Nobody can't solve this problem without your code, because there a million variants of your problem. Just give a parameters of objects and world init.
Semtiko
 
Posts: 732
Joined: Tue Oct 18, 2011 9:03 am

Re: Interpenetration Box2d

Postby carisma_fe » Tue Jun 05, 2012 1:34 pm

I've solved the problem.
I passed as parameter to the function createLoop(), a Vector2[] containing the first couple of coordinates (x,y) equal to the last:
like [x0, y0, x1, y1, ... xN,yN, x0 y0].

An array like this works only if you use the function createChain instead createLoop.
carisma_fe
 
Posts: 4
Joined: Thu May 31, 2012 10:06 pm


Return to Libgdx

Who is online

Users browsing this forum: Alexa [Bot] and 11 guests