1. Collision detection improvements

Does anybody know about other methods to reduce the number of collision test? What are the common methods to detect collision precisely and implement a realistic collision response which can handle point-pint interaction forces or surface friction forces.

2. Hey, I'm about to start a 2d simulation program...and thought of solving the said problem in this way..
1.Calculate the vector distance between the CM s of the objects in question....say x
2.Let the extents of either body in *that direction be a & b
3. if(x<=(a+b) <collision occurs>
....Any comments about how feasible it is?...I thought that it'd have accurate results ...But would it be too expensive?

3. Originally Posted by Sunbel
Does anybody know about other methods to reduce the number of collision test? What are the common methods to detect collision precisely and implement a realistic collision response which can handle point-pint interaction forces or surface friction forces.
Split level into sectors (if that's what you mean). For example, if your map's size is, lets say, 20000x10000 points, you can create 100x50 square sectors (each of 200x200 points). If an object A occupies 2 sectors (10;10) and (10;11) and another object B occupies also 2 sectors (10;11) and (11;11), there is a possibility that they collide in the sector (10;11). Access to sector is O(1). You pick only these objects, which are likely to collide, no matter how many objects are on the other edges of the map.

The problem might appear when your map grows/shrinks dynamically.

4. There are several optimizations you can do when collision testing to eliminate the need for an O(n^2) list. One of them is to separate the world into static and dynamic objects. Only test dynamic objects against other static objects. The list of dynamic objects is sure to be less than the number of static objects. Combine this with the aforementioned sectorized approach and/or a BSP or Quad-tree spatial data structure (depending on the type and usage of the world) as well as the common trivial rejection tests like sphere, AABB, OOBB, swept sphere, swept AABB (separating axis theorem) and you should be able to get good results.