Box2d too much for Circle/Circle collision detection?
Posted
by
Joey Green
on Game Development
See other posts from Game Development
or by Joey Green
Published on 2012-10-24T19:07:14Z
Indexed on
2012/10/24
23:18 UTC
Read the original article
Hit count: 486
collision-detection
I'm using cocos2d to program a game and am using box2d for collision detection. Everything in my game is a circle and for some reason I'm having a problem with some times things are not being detected as a collision when they should be.
I'm thinking of rolling up my own collision detection since I don't think it would be too hard.
Questions are:
- Would this approach work for collision detection between circles?
a. get radius of circle A and circle B.
b. get distance of the center of circle A and circle B c. if the distance is greater than or equal to the sum of circle A radius and circle B radius then we have a hit - Should box2d be used for such simple collision detection? There are no physics in this game.
© Game Development or respective owner