Voxel-based polygonal mesh collision detection,
Members - Reputation: 1344
Posted 05 October 2012 - 04:26 AM
I'm trying to figure out how to do terrain collision using my terrain mesh that is extracted from voxel density volume (method similar to Marching Cubes and such). In the past, on non-networked project, I used voxel data for player<->terrain collision, because it seemt to be most logical way. I could just sample the voxel volume at certain points (head, legs etc.) and interpolate values to get the data required for processing collision with the terrain.
But now, I ran into a problem, because I want my game to be networked and I don't plan on sending voxel data to players (for gameplay reasons, but also performance). I want to be able to do at least some simple client-side prediction, so I don't end up with players walking into walls before the server verifies its wrong.
So what I have on client side is triangle mesh of the terrain, which can have overhangs, caves etc. and I need to perform collision prediction using only this data (while server has both, mesh and underlying voxel volume info). How can I perform such collision, so not only player don't fall into the terrain, but also can't walk into narrow spaces or caves, and don't clip with overhangs? Is it possible to achieve with usual physics engines by supplying terrain mesh, and is it efficient? How does it work? Is the mesh simplified in some way, and then what sort of computation is needed to see if players collides with his head, legs, and how to adjust his position?