Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3d race game collision detection

Can somebody explain how the collision detection works for race tracks in games like need for speed or wipeout?

like image 210
user389006 Avatar asked Jul 11 '10 19:07

user389006


People also ask

How does 3D collision detection work?

This consists of wrapping game entities in a non-rotated (thus axis-aligned) box and checking the positions of these boxes in the 3D coordinate space to see if they are overlapping. The axis-aligned constraint is there because of performance reasons.

How do games detect collision?

One of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. The algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. Any gap means a collision does not exist. Note: Another example without Canvas or external libraries.

What game has the most realistic car damage?

drive isn't necessarily a racing game, more a driving game, but when it comes to actual racing, few games have as good a damage model as Dirt Rally. The way the bodywork bends and disintegrates, the wheels bend out of alignment and fall off and the more realistic way the cars pick up damage is all mightily impressive.


1 Answers

I found a well illustrated article describing collision detection between the cars in a racing game. It also has a general description of the concepts of collision detection.

For the track collision detection you could use something like the color map approach discussed here. Essentially you just draw a map containing your track in a distinct color. Then you read the color at the projected position of the car from the map - if it's the tracks color you have a collision.

I found another seemingly good article describing basic 2D collision detection algorithms.

HTH.

like image 151
andyp Avatar answered Nov 27 '22 18:11

andyp