Jump to content
  • Advertisement

Archived

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

extralongpants

collision detection softening

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

Alas, I am having troubles with collision detection (doesn't everybody). My collision detection code is very similar to the sphere-polygon collision code from GameTutorials. My problem is this: collisions are very jittery when the camera (or sphere) comes in contact with a corner of a wall (two adjacent polygons at a 90 degree (or other drastic) angle). As the camera slides along the wall and comes to the adjacent wall, the camera will often bounce as a result of colliding with the second polygon, when technically it shouldn’t. Here’s a picture for clarification:
camera ______
      /           |        |
     |        | --->
      \______/
-------------------------
                        |
                        |
                        |
                        |
 
So, essentially, as the camera slides along wall01, the program detects a collision with wall02 and bounces the camera backwards, even though the two polygons share the same end points (which should theoretically keep the camera from bouncing). The only reason I can come up with is that the velocity of the camera is pushing the camera’s bounding sphere into the polygon. (I also have problems with this when I add a gravity vector to the camera). To temporarily solve this, I constructed the polygons so that walls have a gap in the corner. This works OK, but it’s really inconvenient. I was hoping that someone might have some better ideas on how to soften my collisions in such situations. Anyway, that was a lot of explaining, and I hope that my problem was understandable. I would greatly appreciate any help. Thanks. -Chris [edited by - odiousangel on June 1, 2002 7:13:14 PM] [edited by - odiousangel on June 1, 2002 7:15:01 PM]

Share this post


Link to post
Share on other sites
Advertisement
You might want to read this article on the collision detection and handling in MDK 2. It deals with deflection forumlas to allow "sliding" along walls.

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!