Jump to content
  • Advertisement


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


Help Needed on Collision Detection Algorithm

This topic is 5584 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

Hi everyone, I would like to request help on a collision detection algorithm that I have written. Its purpose is to detect collision between a bounding box and the surrounding walls, which are made of triangular polygons. I tested whether the 4 longest diagonals of the bounding box intersect the wall polygons. The algorithm worked fine in most cases, except in this particular instance: Whenever the box approaches 2 walls that meet perpendicularly at a corner that is jutting out, with the box moving such that it will move parallel to one wall, just touching the wall but not intersecting it, then the algorithm detects collision when the box first reaches the corner and then it doesn''t detect collision after the box has moved on from the corner. Try as I might, I haven''t been able to debug this problem. Could anyone help me with this problem? Thank you very much

Share this post

Link to post
Share on other sites
It sounds like your line-to-edge detection is picking up the collision, but your line-to-face detection is missing it - not uncommon.

It's pretty tricky to get both unit tests to agree - there will always be cases where floating point innacuracy causes discrepancies.

For the record, I'd highly recommend the seperating axis method for CD between a box and a triangle. Once you strip it down to the minimum it's very fast, has lots of early outs, and is well suited to temporal coherency optimisation.

Take a look at Magic Software and don't forget to read the Licence if you use the code.

[edited by - Osc on August 8, 2003 8:53:44 AM]

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!