breaking up meshes for collision detection

Started by
2 comments, last by circlesoft 19 years, 3 months ago
I have a tank that i would like to move around a 3D terrain. each collidable object in my scene has a sphere surrounding it to easily know if they have a possibility of hitting. once the spheres are touching I would like to break my mesh into smaller BoundingSpheres or BoundingBoxes to refine my collision detection. how is the mesh broken down into smaller pieces?
Advertisement
After you get the local collision detection with your sphere you could use MeshIntersect or MeshIntersectSubset to get accurate detection as to whether the mesh is hitting anything. This can be problematic if you're intersecting one mesh with another however since you can only cast rays. I use it mainly for bullet hit detection, but you could probably adapt it to your needs. Otherwise you can try and split it into smaller bounding spheres/boxes (perhaps one for each mesh subset?)and check those once it passes the larger box/sphere test.
I'm definitely no expert, but I've heard that Mesh.Intersect() is not a good method to use for tracing bullets or collision detection.

And I have no idea why, it's just what I've heard;)
If the initial bounding box/sphere test returns positive, you probably want to jump right to triangle level collision detection. Here are some good links that can help you get going with it:

Flipcode Tutorial
Collision Algorithms
More Algos
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement