Sign in to follow this  
q2guy

Fast moving objects

Recommended Posts

q2guy    122
When you manage the collision of fast moving objects (or no so fast), you have to precalculate the future positions of the object, and see if It collides with other objects and if there are interpenetrations, but you have to do this for all objects ? if there are much objects it will slow down all the simulation a lot. How you select what objects to test for this ?

Share this post


Link to post
Share on other sites
oliii    2196
not quite. Instead, the collision test is done using the swept vector (velocity of disaplcement of the object), as an integral part of the test. This returns the time of collision. In particular, Quake3 uses BSP trees and ray-tracing techniques to do the collision detection and compute the monet of impact. THen it moves the object (usually a bounding box) to that time, and slide / reflect the object on the normal. For player against players, I'm not 100% sure, but it probably uses the same technique, of sweeping the boxes against each other and finding the time of collision.

To reduce the number of call, you use broad phase culling (fancy word for 'sorting' collisions and minimise the number of tests).

Share this post


Link to post
Share on other sites
SimmerD    1210
Usually you use some sort of spatial data structure to minimize the number of object pairs you have to check.

One way is a 2d or 3d grid. Another is an octtree. This way you can quickly find objects nearby the current & future position of the moving object.

You also can choose not to handle > 1 collision per object per frame to speed things up. For instance, once you detect a real collision ( ienot a time == 0.0 collision like gravity for an object on a floor ), you may choose to only detect an simulate up to its first collision, update its velocity for next frame, and then go on to the next object.

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