Archived

This topic is now archived and is closed to further replies.

DirectXXX

RESPONSE(reacation) of collision between circle and rect

Recommended Posts

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.

Share this post


Link to post
Share on other sites
There is an excellent tutorial on this on gamedev.

Physics->General collision detection using ellipsoids

[URL]www.gamedev.net/reference/articles/article1026.asp[/URL]

GreetZzz

Share this post


Link to post
Share on other sites
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



Share this post


Link to post
Share on other sites