Skip to main content
gamedev.net
🔒 Locked

collision detection problem

Started by Stardust Oct 31, 2002 at 4:39 AM 1 replies 350+ views
Original Post
Stardust
Stardust
Hi! I''m creating a racing game and I don''t know how to fix this problem. Right now I send a ray from the center of the car to se if it hits any wall, this method stinks. First of all I don''t want it in the center I want it to be on the edge of the car and second I don''t want to send a ray I want to check the entire front/side/back of the car, for example now if I hit a small object (thinner than the car) I can pass right trough it if is just a bit off the center of the car. I would like to send a ray that is as thick as I want to see if anything is in that area. the only thing I can come up with is to take the three coords of every face and devide the length between them into suitible chunks and send for example a ray from every 5 points, but that sound like it can get slow. Around the car I could send hundreds of rays or so, say I have 20 cars, 2000 - 5000 (or something) intersections every frame isn''t it possible that it might get a bit slow? in this case I also need to use the index buffer? so I don''t check the coords more than once. well any ideas of how this should be done? thanks!
nachilau
nachilau
Hello,

I am currently writing a racing game too. I have tried many collision detection methods, and finally I found out that the best way to detect collision is just use 2D bounding rectangle detection. It is especially good for a racing game, since we mainly need to detect the collision between two car, and mostly, car does not have a irregular shape. Also, the car only move horizontally. You don''t really need to have a compliacted 3D bounding box.

Wish it can helps!

Nachi
Nachi Lau (In Christ, I never die)www.sky-dio.com/Nachi
Stardust
Stardust
thanks for the reply!
it sounds like a good approch, I''ll look into it!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.