# Tetrahedron vs Sphere (yes, another specific collision detection problem)

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I need to check the intersection of a tetrahedron (ie. four point 3d object) and a sphere. It needs to be very fast and I don't think what I've come up with so far is going to cut it: For each face: Get the closest point on the plane. If the sphere is above the plane, return false. If the sphere intersects plane, and the point is within the face, return true. Otherwise, continue. Also record whether the sphere intersects the plane or not, so that if we find that it doesn't intersect any of the planes, we can return true immediately (completely within tetra) Now, I think this is great except for the case where the sphere intersects one of the corners/edges... And I don't want to try getting the distance to all six edges as a final check. Maybe I'll have to... Can anyone think of a better idea? I'd check www.magic-software.com but it doesn't appear to exist anymore :( PS: Know any good alternatives to magic-software? Thanks [Edited by - averisk on August 6, 2005 1:30:07 AM]

##### Share on other sites
http://www.geometrictools.com/

[Edited by - John Schultz on August 6, 2005 2:44:56 AM]

##### Share on other sites
Though it only includes tetrahedron/tetrahedron collision, unfortunately

##### Share on other sites
Check if the sphere is inside all the planes, if true, is intersecting, return.
Find the distance to each triangle, store the nearest distance found (or distance^2), check against sphere center and radius (or radius^2). The Geometric Tools site has a triangle distance example.

A Voronoi region method could also be used (see Wm3DistVector3Frustum3.cpp).

Another triangle-distance method is shown in Real-time Collision Detection.

That will do :)

rating++

##### Share on other sites
Voronoi, GJK, continuous, etc., with source and demos here (register to login to access examples, files. Forum access does not require login).

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633324
• Total Posts
3011364
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!