Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    375
  • comments
    1136
  • views
    298207

Collision meshes

Sign in to follow this  
superpig

81 views

It's a fairly common idea, that one should have seperate meshes for collision detection and for rendering. The rendering one is high-poly, while the collision one is low-poly. I've been thinking about ways to generate decent collision meshes algorithmically; doubtless there is material already out there, I've not got around to reading it yet.

Generating a collision mesh for a non-convex object is specifically the thing I'm wondering about. How could I generate a mesh for, say, a four-legged table? Or a car that the player can sit inside? I suspect many people just generate the convex hull, but that'd make my table seem like a box.

It'd probably be helpful to define some metrics. Given a collision mesh and a rendering mesh, and assuming that each is closed, we can find the volume that each encloses. If we 'subtract' the volume enclosed by the rendering mesh from the volume enclosed by the collision mesh, and sum the resulting pieces, we get a metric for the difference in volume between the two meshes. Furthermore, if we actually consider the pieces enclosed by the rendering mesh but not by the collision mesh as 'negative space,' our metric is signed - a positive metric means that the collision mesh is generally enclosing the rendering mesh, and a negative metric means that the rendering mesh is enclosing the collision mesh.

So we can consider that metric, and we can consider the number of polygons in the collision mesh. Essentially, we want to minimize both, but the fewer polygons you have the harder it becomes to match the meshes, so it's a tradeoff.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

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!