Reputation: 54212
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)
Upvotes: 0
Views: 2339
Reputation: 31
You can use CGPath to detect collission for irregular rigid bodies. See http://bobueland.com/cocos2d/?p=379
Upvotes: 1
Reputation: 14816
Here are some references you might try:
Upvotes: 2