Simultaneous collision with multiple static shapes
Posted: Thu Dec 02, 2010 6:17 pm
Hi,
firstly, thank you! Chipmunk is so much fun to work with. I've just started out on iPhone development and am enjoying working with your physics engine immensely!
Once strange behaviour I have seen is that if I have a row of static boxes, like bricks in a wall, when a circular body bounces off them, it bounces at an unexpected angle (ie not angle-of-incidence = angle-of-reflection ). I'm assuming this is because the circular object is hitting the vertices of one or both boxes and the circle-vertex collision is some how overriding the circle-line collision that would occur on the same frame?
I need the static boxes to all exist separately as I'm trying to write a "music generator" that plays sounds, notes, etc when balls hit the different blocks, and it is much easier to treat each block as a distinct object.
I've tried "growing" the collision boxes slightly to get the edges overlapping with the vertices, and I've tried increasing the number of iterations the engine does to improve detection, but neither of those seem to be the solution.
Is there something else I should do?
Thanks in advance to anyone who can help,
D.
firstly, thank you! Chipmunk is so much fun to work with. I've just started out on iPhone development and am enjoying working with your physics engine immensely!
Once strange behaviour I have seen is that if I have a row of static boxes, like bricks in a wall, when a circular body bounces off them, it bounces at an unexpected angle (ie not angle-of-incidence = angle-of-reflection ). I'm assuming this is because the circular object is hitting the vertices of one or both boxes and the circle-vertex collision is some how overriding the circle-line collision that would occur on the same frame?
I need the static boxes to all exist separately as I'm trying to write a "music generator" that plays sounds, notes, etc when balls hit the different blocks, and it is much easier to treat each block as a distinct object.
I've tried "growing" the collision boxes slightly to get the edges overlapping with the vertices, and I've tried increasing the number of iterations the engine does to improve detection, but neither of those seem to be the solution.
Is there something else I should do?
Thanks in advance to anyone who can help,
D.