Saturday, April 9, 2011

2


Problem:  A program was made to joint balls in Box2D together whenever they collided with each other. The program would crash as soon as any balls were on the screen. The collision detection written to see if balls had collided didn’t make a distinction between a ball and itself. As soon as a ball was made, the program would register the ball as colliding with itself and attempt to joint it to itself. Box2D doesn’t allow this to happen, so the program would crash.

Impact: The program would crash almost immediately on startup, making it mostly useless.

Solution: By making the hitbox detection never compare an object with itself, this problem was fixed.

No comments:

Post a Comment