-
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
-
You can try simple rectangle intersection test, or a reduced rectangle intersection test. Google is your best friend.
-
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´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
-
try "Physics for Game Programmer" by O'RIELLY it might offer some help, it has point in polygon tests and other collision detection stuff.
-
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]