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

Collision meshes

Sign in to follow this  


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  


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!