Possible dynamic body collision bug

Discuss issues specific the Java port of Box2D
Posts: 1
Joined: Wed Oct 07, 2015 7:53 pm

Possible dynamic body collision bug

Postby dpswt » Wed Oct 07, 2015 8:12 pm

Hi, I'm creating a 2D top-down game, and I've stumbled upon the weirdest behavior on my dynamic bodies collision. I've tried to search about this problem but no luck so far.

Essentially, I'm moving and rotating my dynamic bodies with forces (linear impulse and angular impulse). It's based on the tutorials from iforce2d so I think the code is sound enough. Now, it all works wonderfully! Every dynamic body interacts with each other and other static bodies as they should, EXCEPT for one particular situation.

Let's say a dynamic body is in a corner and is infinitely walking towards a wall (needs to be a static body) in that corner. If another body is walking towards the same direction, and is colliding with the first body, the collision will be completely ignored, and I have no idea why! It's the only situation where this happens.

To illustrate this a little bit better, here are some screenshots:
1 - The little guy with the hair is NOT moving, the bald guys are: Collisions working as intended - no clipping whatsoever! http://i.imgur.com/6qia4C3.png
2 - The little guy with the hair IS moving towards the left wall: Collisions WITH the right bald guy is NOT working! http://i.imgur.com/cCO8cL4.png

In situation 2, if then I move the little guy with hair to the right just a tiny bit, then the collision resets, and pushes the bald guy back.

I will say this again though, this very specific situation is the ONLY time the collisions are ignored, rest of the time it works great. And I am indeed working with forces and NOT with transforms.
If someone has any idea about this, I would gladly appreciate it.

Return to “Java”

Who is online

Users browsing this forum: No registered users and 1 guest