Sign in to follow this  
Suresh Kumar k v

Collision in 3d car game

Recommended Posts

I am making a 3d car driving game.The car physics are almost completed and almost realistic.Now I need to incorporate car-car collision effects.I have seen that GTA(Grand Theft Auto) and some other games use a collision model that is made up of only spheres.I know how to detect collisions with a collision model like this but WHAT I DONT KNOW IS HOW TO CALCULATE THE COLLISION NORMALS In these models the actual collision normal may not always be the normal corresponding to the spheres that collided. I would also like to know which is the best method to implement a realistics car-car collision in a 3d driving game

Share this post


Link to post
Share on other sites
yanou    122
I'm not a specialist in collision effects but I think that this project will be very interesting in your case : http://rars.sourceforge.net/

I hope this help

Yannick


Share this post


Link to post
Share on other sites
oliii    2196
if you alreay have spheres, then it's sorted.

In Rollcage, for example, cars are made of 6 spheres (plus 1 per wheel), and the collision normals are nothing more than when doing sphere/sphere collisions.

That's a decent approximation, if rather low tech (Rollcage was made for the PSX and Pentium 1 systems). You can always increase the sphere density to get a better approximation. YOu can also build a sphere tree to speed up the test and increase the density.

Else, you can use a collection of boxes or convex hulls, and perform collisions with those. Obviously, you'll need a much more capable collision system (Swept GJK, or advanced SAT).

I'd stick with spheres for a while. It should take about a week to experiement and get decent results. If you're not happy, look into convex hull collisions. But that would take at least a month to get right.

Spheres also have the advantage of not having sharp angles, which makes collisions more forgiving and less harsh.

Share this post


Link to post
Share on other sites
oliii    2196
there are plenty of samples for sphere-sphere collisions, and triangle-sphere collisions.

Sphere-sphere is relatively trivial.

here is one.

http://www.gamedev.net/reference/articles/article1234.asp

triangle-sphere is a little bit trickier. That would be for car-mesh collisions (like buildings, and so forth).

so here is another one.

http://www.fluidstudios.com/?freeware
http://www.fluidstudios.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf

If you read the docs, the actual procedure is relatively simple. Just a little but of linear algebra.

You can apply the principles of the second paper for the sphere-pshere colision response.

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