Detecting Collisions?
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 :)
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.
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.
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement