I've posted this in my previous thread but got no replies so I'm creating a new topic.
I'm developing a billiards game. I can detect a body at high velocity hitting a wall surrounding the pocket. There are cases in which I don't want to destroy the ball's body at this point. Instead, I want it to bounce off the wall and I want to disable it's collisions with other balls. I try to do that using collision filtering and generally it works, but there are times when the ball bounces off and still has a high speed. If there's another ball near enough, it gets hit before the collision filtering is applied.
My guess is that when the ball bounces off the wall and I set the filtering (using maskbits) it isn't applied until the next step of the simulation. And a nearby ball gets hit in the same step in which I set the filtering. Am I right?
Any ideas on how to solve this?
I'm developing a billiards game. I can detect a body at high velocity hitting a wall surrounding the pocket. There are cases in which I don't want to destroy the ball's body at this point. Instead, I want it to bounce off the wall and I want to disable it's collisions with other balls. I try to do that using collision filtering and generally it works, but there are times when the ball bounces off and still has a high speed. If there's another ball near enough, it gets hit before the collision filtering is applied.
My guess is that when the ball bounces off the wall and I set the filtering (using maskbits) it isn't applied until the next step of the simulation. And a nearby ball gets hit in the same step in which I set the filtering. Am I right?
Any ideas on how to solve this?