Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] 2d collision system

Author
Message
Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 24th Dec 2010 06:53
2d collision - sphere<->line


The program I wrote figures out the point of intersection during the process, so once you get the point of intersection, you can just do point collision response, which is basically this (where C is the center of the circle, P is the point you're colliding with, d is the distance between the two points, x with ^ over it is the direction from C to P, and r is the radius of the circle):

so its actually prty simple once the point of intersection is figured out.

Login to post a reply

Server time is: 2024-04-16 10:53:04
Your offset time is: 2024-04-16 10:53:04