brainclog wrote:
I'm not sure whether that's really necessary because it seems as if maybe the friction of the bodies involved should just be lower to begin with.
I need the high friction because the player is a rolling ball. Without the friction, the ball just spins and doesn't go anywhere.
brainclog wrote:
I actually use something like this loop to check against a list of shape pair types to look for so that I can execute a certain function or event when a collision happens. I'm using a 2-dimensional Dictionary to hold these pairs. Works pretty well!
Thats very, very similar to what I'm doing right now (except I loop through on a per-body basis, as opposed to per-shape). The problem isn't knowing which bodies are in contact, but determining what contacts are preventing rotation via friction. For every iteration, if the ball should-be-but-isn't rotating, I have a set of high friction contacts, some subset of which are preventing the ball from rolling. The problem is figuring out which contacts are the problem and negating them without guessing over each iteration.
So say a ball is stuck in a high friction "V", and tries to roll-right, up and out of the V. It can't, because it will also be rolling
down the left side of the V at that instance (it's in contact with both sides when it's at the bottom ). No problem - set the friction of the left side of the V to 0. The problem is doing this in a general sense.