# collision detection

• 2003-05-08, 22:02
JWone
collision detection
Hello,

I'm searching for some algorithms to modell some physiks and for collision detection in a 2d game. For example how to modell that a ball is hit by a paddle, has anybody some expiriences or can tell me a good link to find out something more???

thanks

Jan
• 2003-05-09, 02:55
lukemaung
You can try simple rectangle intersection test, or a reduced rectangle intersection test. Google is your best friend.
• 2003-05-12, 13:26
JWtheCoolOne
thanks lukemaung,

but I still have a problem, with a rectangle interception test (as far as I understood) I can only test for example if a moving ball hit a resting paddle. But I want to calculate the interception between a moving paddle and a moving ball.

For example:

xb = vx * t
yb = vy * t

xp = x0 + r * cos(wp * t)
yp = y0 + r * sin(wp * t)

wp is the constant angular velocity

I thougt of something like:

(vx * t - x0)/(vy * t - y0) - 1/tan(wp * t) = 0

->

f(t) = tan(wp * t) - (vy * t - y0) / (vx * t -Y0) = 0

But I don&acute;t think that I can solve such a equation in realtime on a mobile phone...(I think I would have to use something lika a gausian approach proceeding...).

any idea???

thanks

Jan
• 2003-05-23, 15:15
jrbayliss
try "Physics for Game Programmer" by O'RIELLY it might offer some help, it has point in polygon tests and other collision detection stuff.
• 2003-05-25, 15:23
dima_boul
from my point of view, one of best and easiest resource about 2D and 3D collision and physics is next
[url]http://www.d6.com/users/checker/dynamics.htm#samples[/url]