Get Updates By E-mail 

collision detection

Easy And Accurate 2D Collisions

  •  
  •  
  •  
  •  
  •  

It is a simple process to perform box collisions in Cocoa Touch using the CGRectIntersectsRect function, and while this is easy and provides decent performance it does not make for the most accurate collisions.

A couple of new tutorials have been created featuring techniques for creating more accurate collisions methods.

The first tutorial is from 71 Squared on Collision Detection Methods which has a some nice straightforward functions written in C that you can drop into your code for Circle to Rectangle, and Circle to Circle collisions.

The second tutorial is from Ray Wenderlich, the creator of the Space Game Starter Kit and co-author of the Learning Cocos2D book, and goes through the process of how to use sprites in Cocos2D and how to get extremely accurate vertex based collisions using box2D in How To Use Box2D For Just Collision Detection In Cocos2D iPhone.

[Source: 71 Squared, Ray Wenderlich]


  •  
  •  
  •  
  •  
  •