views:

566

answers:

1

When there are two objects going to collide, I check them with CGRectIntersectsRect. However, before it returns me with YES (they collide), they are already overlapped. Is there any other way to detect and resolve collision?

My workaround is to compare their Y axis and move the object far apart from each other, once they are detected collision.

Also, one of my objects is a circle, is there any other functions for iPhone SDK to detect the collision better? (currently I treat the circle as a rectangle, as its frame is a rectangle)

+2  A: 

Here are some references you might try:

Sixten Otto
thanks for finding me references! that helps! i hope iPhone SDK will release functions for circle-rectangle collision detection.
Shivan Raptor