Page 1 of 1
which type of collision detection would you recommend?
Posted: Wed Jul 07, 2010 9:16 pm
by cndr
I am using SDL and have a circle on screen which I would like to use for a button. Which method of collision detection would be best for this scenario?
Re: which type of collision detection would you recommend?
Posted: Wed Jul 07, 2010 9:39 pm
by ibly31
For circles, I usually use pythagorean theorem to find the distance from the click to the center. If it's less than the radius, its inside. Only for circles though.
Re: which type of collision detection would you recommend?
Posted: Thu Jul 08, 2010 4:26 am
by MrDeathNote
ibly31 wrote:For circles, I usually use pythagorean theorem to find the distance from the click to the center. If it's less than the radius, its inside. Only for circles though.
Yea, this is pretty much the way to go for circles.
Re: which type of collision detection would you recommend?
Posted: Thu Jul 08, 2010 6:29 pm
by Ginto8
Re: which type of collision detection would you recommend?
Posted: Thu Jul 08, 2010 9:39 pm
by cndr
sorry for the delay, thanks for the help the Pythagorean theorem works great.