Advertisement Jump to content
Sign in to follow this  
Sirisian

2D Polygonal Hitdetection With Moving Objects

This topic is 4548 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 usually fairly good at understanding things and figuring them out myself. However, I'm having a really hard time finding out how to implement perfect collision with moving polygons against static polygons. I've implemented some ways that I thought would cover everything and keep errors out but I keep finding exceptions to my methods. http://img220.imageshack.us/img220/3459/probllemvn0.png I don't know how to show an image. But if you look at that it shows part of my problem. I am completely stuck. I've been working on this problem for over 3 weeks. You guys program games here so you must know how to do this. Any help would be greatly appreciated. Links too.

Share this post


Link to post
Share on other sites
Advertisement
For either moving or static (convex) polygons in 2D, your best bet is the SAT (Separating Axis Theorem). Whether you need the swept or discrete test depends on the magnitude of the objects' displacements relative to their sizes. In many cases you can get away with the discrete test only (which is slightly easier to code than the swept version).

Just google 'separating axis theorem' and you'll get a bunch of hits on the topic. Also, check out geometrictools.com for documentation and example code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!