| [edited 15 times; latest by CGameProgrammer on 1096862400 -- highlight modified text] (This is the first part of what will eventually be a complete article on triangle-triangle collision.)
Common Methods for Collision Testing The most common method for detecting collision between two triangle meshes is to test for the intersection of the two and adjust the position of one or both of them if they intersect. That is prone to many errors, especially if one mesh is moving very fast and runs up against a very small mesh; it will just pass right through it very often. Additionally, adjusting its position could make it intersect another mesh, possibly one it had already been collided with. Intersection testing just does not work in many cases.
Overview of Triangle-Triangle Collision Handling
Top: The blue star is blocking the path of the moving red star. The distance between the two along the red star's movement vector is equivalent to the length of the green line.
Bottom: The red star moved the length of the green line and is now adjacent to the blue star. | There's a far more reliable method for detecting collision between two triangle meshes. On the top half of the image on the right, there are two triangle meshes -- a red star and a blue star. The red star is moving in the direction indicated by the fat red arrow. The blue star is stationary.
It can be seen that the blue star is in the path of the red one since it occupies space inbetween the outer boundary planes indicated by the long thin red arrows. That means the distance between the two stars, along the red star's movement vector, is finite, and a collision may occur. The distance between the two along the movement vector is equal to the length of the short green line. It's not the shortest distance between the two objects; it's the shortest distance between the two objects along the movement vector.
On the bottom half of the image, the red star has moved as far as it can (the length of the green line) and is now flush with the blue star. If the red star was supposed to move further than this, then it moves only to this point as it's a collision. If it wasn't supposed to move this far, then it doesn't, and there is no collision.
(don't mind me, I'm just testing scripts)
|
| |
| |