Can someone explain how collision detection works for racing tracks in games such as the need for speed or erasure?
I found a well-illustrated article describing collision detection between cars in a racing game. It also has a general description. collision detection concepts.
For detecting track collisions, you can use something like the color map approach discussed here . Essentially, you simply draw a map containing your track in a specific color. Then you read the color in the projected position of the car from the map - if you have the color of the track, you have a collision.
I found another seemingly good article describing the basic algorithms for detecting two-dimensional collisions.
NTN.