Sign in to follow this  
phb5000

Detecting Collisions?

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this