Jump to content
  • Advertisement
Sign in to follow this  
phb5000

Detecting Collisions?

This topic is 4518 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, Im looking for some advice on collision detection? My application renders/updates using real-time, what would be some suggested ways of calling the checking for collisions? If my application were to lag out causing a "large" update on the next frame a moving object might update so much that it moves past another object. Should I split up the objects movement and check for collision on different points on each movement path? Any feedback is appreciated :)

Share this post


Link to post
Share on other sites
Advertisement
Yes, that is one very common way and it is the easiest one. If you have to simulate physics for a large amount of time (say 0.25 seconds) do it in smaller increments (say 0.05 seconds five times in a row).

The other option for accurate detection is to create a "stretched object" along the whole path of movement, but that is way more complex. I haven't actually seen that method used, although it is mentioned here and there.

Share this post


Link to post
Share on other sites
may help this tutorial.
http://www.toymaker.info/Games/html/collisions.html

Share this post


Link to post
Share on other sites
Quote:
Original post by SOS
The other option for accurate detection is to create a "stretched object" along the whole path of movement, but that is way more complex. I haven't actually seen that method used, although it is mentioned here and there.


Newton ( http://www.physicsengine.com ) has a continuous collision detection option. Also, the there's a library called 'Bullet' that seems to be based entirely on the concept of continuous collision detection ( http://www.continuousphysics.com/Bullet/ ).

I'm sure a few others use it too (Havok?). I don't know much about the calculations behind it, but it seems stretching/skewing the body before testing for collisions would be an easier/faster operation than running your collision code 5x times with small steps.

I think all you'd have to do is multiply the body's collision hull by a matrix that skews it along the movement vector by the desired amount.

- Dan

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.

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!