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.

Newcomers DBPro Corner / Projecting Intersection Information onto a Normal's Plane (2D)

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Feb 2007 23:32 Edited at: 15th Feb 2007 23:33
Ive been working on getting 2D Sliding Collision working lately, and Im almost done. So far Im able to slide along 2D lines using circle collision, but the problem is corner's (both convex and concave) provide some problems.

This post in the code snippets board shows my progress

This picture outlines my basic problem (from http://www.gamedev.net/reference/articles/article1026.asp)



I understand what needs to be done, just not quite how to do it. Basically the information from the site provided above says that you need to find out which normal is the closest to the collision circle's centre, and then get the sliding position based on the normal's plain (which extends to infinity in both directions of the normal) instead of just the normal.

Im able to get the distance from a point to a line (with the help of phaelex's snippet), but Im not sure how Ill get the closest normal to a point, Id have to cycle through every position on each normal getting their distance to the circle until I found the shortest distance I think, which seems pretty intense.

Other than this my last problem (easier to solve Im pretty sure) is stopping the user from travelling as they enter corners too tight for them to go in, like this:



From reading the information on the sight I provided, it looks like getting the plane information is a pretty difficult process. Im not really looking for code, as I like working out the programming side of things myself, but does anyone have any tips or pointers, or better explanations, of what I need to do here?

Thanks,
- RUC'

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Feb 2007 00:26
Ruccus:

Just had an e-mail I sent to you returned. Got a new one?

Drop me an e-mail when you can please.

TDK_Man

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 16th Feb 2007 00:31
Email sent.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Feb 2007 00:41
Cheers - replied!

TDK_Man

Login to post a reply

Server time is: 2024-09-25 17:24:40
Your offset time is: 2024-09-25 17:24:40