cpspaceRemoveShape() should use a different callback.
Posted: Mon May 21, 2012 12:29 pm
A while back a had a problem with cpspaceRemoveShape() http://chipmunk-physics.net/forum/viewt ... f=1&t=2010
I saw the issue was fixed, but even still I think cpspaceRemoveShape() should have its own callback and not use the separate callback.
For example, when Shape A separates from Shape B you "play a sound and update the score in the separate callback".( Maybe something like a runner crossing a Finish Line.) But say Shape A can be destroyed by a missile. The missile can remove Shape A from the Space. If Shape A is in contact with shape B at the time of being destroyed, this will trigger the "sound and score update in the separate callback" when it is not wanted.
It feels weird to have collision callbacks occur outside the step. To me separate from natural physics is very different than separate by space removal.
To counter this problem I usually give an extra Boolean property to my objects. But I think this should be unnecessary.
I saw the issue was fixed, but even still I think cpspaceRemoveShape() should have its own callback and not use the separate callback.
For example, when Shape A separates from Shape B you "play a sound and update the score in the separate callback".( Maybe something like a runner crossing a Finish Line.) But say Shape A can be destroyed by a missile. The missile can remove Shape A from the Space. If Shape A is in contact with shape B at the time of being destroyed, this will trigger the "sound and score update in the separate callback" when it is not wanted.
It feels weird to have collision callbacks occur outside the step. To me separate from natural physics is very different than separate by space removal.
To counter this problem I usually give an extra Boolean property to my objects. But I think this should be unnecessary.