Skip to main content
GameDev.net gamedev.net
🔒 Locked

Intersection Test Question.

Started by cbmeredith Jan 7, 2004 at 8:49 PM 2 replies 950+ views
Original Post
cbmeredith
cbmeredith
Hi all. I''m trying to detect collisions between the wheels on my car, and the terrain. In order to do this I need to be able to tell when my wheels are in contact with the terrain (which is made of triangles). Does anyone know how you check for intersection between a cylinder (the wheel) and a triangle (the terrain)? If anyone has a better way of tracking how the car should be positioned on the ground, or testing for wheel contact, I would be more than happy to hear your suggestions. Thanks. Cbmeredith
MrScout
MrScout
Since the wheels are cylindrical, and the cylinder is ... "parallel" to the terrain below...

Check the distance from the center of the cylinder to the terrain. That is, from the line that is the center, to the plane that is the terrain. :-)

Scout



All polynomials are funny - some to a higher degree.
Furthermore, polynomials of degree zero are constantly funny.
All polynomials are funny - some to a higher degree.Furthermore, polynomials of degree zero are constantly funny.
cbmeredith
cbmeredith
That works assuming I know that the wheel is contacting only one triangle, however, I want to be able to test for multiple contact points on the terrain. Also, there is the case of when the vehicle is in the air because of a jump, I need a way of figuring out when the wheels collide with the terrain.

Anyone else got any ideas on the subject?


Cbmeredith.
oliii
oliii
In your case, I'd go for ellipsoids, if the car wheel do not need to contact with things other than triangles. Ellipsoid intersctions are like sphere intersections, except you scale the triangle with the ellipsoid radius (stretch/compress the triangle on the X, Y and Z axis), do a sphere of unit radius collision detection with the modified triangle, and de-stretch the collision information back to the world.

The ellipsoid for your tyre will be quite close to a cylinder, and will model it nicely and efficiently. But doing col det of ellipsoids with things other than triangles and spheres is complicated.

[edited by - oliii on January 8, 2004 4:27:30 AM]
Everything is better with Metal.

Topic Locked

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

Sign in to reply to this topic.