RESPONSE(reacation) of collision between circle and rect

Started by
1 comment, last by DirectXXX 21 years, 5 months ago
i have set my code to detect collision between a circle and rect using radius and disctance techinque. My problem comes to reaction. i used my old simple technince if (collision) reverse velocity but i want accurate response when circle collides with the corner of rectangle. rectangle is static. the circle travels in linear motion. i am using vX and vY for velocity. i thought much to figure it out but was only screwed up.
3D Side-Scroller game demo Project-X2 "playable"Lashkar: A 3D Game & Simulation Project demo @ lashkar.berlios.de
Advertisement
There is an excellent tutorial on this on gamedev.

Physics->General collision detection using ellipsoids

www.gamedev.net/reference/articles/article1026.asp

GreetZzz

-I don''t have a signature :p -
Actually, to find out if the Circle is coming in collision with the corner, there''s a very easy way to do so.

Check at what moment (in time) the circle is colliding with a plan and note this period of time.

In your loop, check if the time of collision is equal to the time of the collision with another plan. If it is, just add the normal of that plan to the normal of the previous plan to find out the normal of the collision.


Also, as Spikey mention, you should check the GamaSutra article to find information regarding accurate collision response.


Nick



This topic is closed to new replies.

Advertisement