Jump to content
  • Advertisement


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


Irregular collision detection

This topic is 6671 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using OpenGL, and I''m loading a level as a series of polygons, all with faces. I want to know how to do perfect collision detection on surfaces (some will be irregular, i.e. leaning in different directions) when I have a list of the vertices on the face I''m going to test. I''ve already done it with straight ramps that all face regularly, but after that it gets a bit complicated! Help! ======== Smidge www.smidge-tech.co.uk ========

Share this post

Link to post
Share on other sites
Uhg, polygon collision is so tedious, I won''t even try to put the entire algo here. Here''s basically how I''ve seen it done, though (for determining if a point has collided with a face):

1) Test if the point is within the "radius" of the face, that is, within the radius of the smallest sphere than can enclose the polygon (pre-compute the faces'' radii).

2) Determine if the point has crossed the plane of the face. I think you get the plane equation from the face''s normal; plug the point into the equation and look at the sign of the result.

3) You could possible just stop here, if all your faces are small and somewhat "circular". Otherwise, for each side (2D line) of the face, test if the point is on the "inside" of the line. Again, get the equation for the line, plug in the point, and look at the sign of the result.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!