First I would recommend creating a face class.
| public class Face |
| { |
| public Vector3[] verts; |
| public Plane plane; |
| |
| public Face(Vector3 v1, Vector3 v2, Vector3 v3) |
| { |
| verts = new Vector3[3]; |
| verts[0] = v1; |
| verts[1] = v2; |
| verts[2] = v3; |
| plane = new Plane(v1, v2, v3); |
| } |
| } |
Then create a custom processor to process the vertex data and store each triangle into your face class. From there just loop through each face seeing if the sphere intersects the plane the triangle lies on. If the sphere does intersect the plane, test to see if it intersects within the triangle. Depending on the amount of triangles in your model, I would recommend creating an octree.
Just google how to do each, they are relatively simple. I am not exactly sure how to determine if the sphere intersects within the triangle, I'm using an AABB for my collision detection.
edit: I believe that to determine if it intersects the triangle, create a ray from the center of the circle with a direction of the triangle's normal. Then determine the point of intersection between the ray and the plane. Then do a simple check if this point lies inside the triangle. And if that produces a false result, make sure neither of the edges of the triangle intersect the sphere. Then if both those tests produce a false result, there is no collision.