Page 1 of 1

Collision Issue

Posted: Mon Apr 22, 2013 9:07 pm
by Blu3
Hey guys, i recently dived into 3d programming with XNA with BEPUphysics as my physics engine of choice.

Im trying to create a tilebased game with each tile being a StaticMesh. My problem is, that if the SphereCharacterController crosses the pass between two StaticMeshes, it can sometimes get stuck for a brief moment.

I assume that's a similar issue like the one described here http://www.iforce2d.net/b2dtut/ghost-vertices

Is there any way to resolve that problem in 3D with BEPUphysics?

thanks a lot!

Re: Collision Issue

Posted: Mon Apr 22, 2013 10:05 pm
by Norbo
Triangle mesh manifolds include a boundary smoothing system to solve this problem. It relies on the index list's connectivity information. So, a properly constructed mesh will not have any 'bumps' at edges.

There is no connectivity information between completely separate meshes, though, so bumps will still occur. If you are truly hitting such bumps, then unifying the mesh with correct connectivity information will solve the issue.

However, a SphereCharacterController should be mostly immune to this problem. A sphere is basically the most extreme version of the 'clipping polygon corners' method suggested in that article. It has no edges at all, so it is particularly hard to get stuck on any discontinuities. (A relatively small and quickly rolling ball may jump on collision with such a border, but a character should not behave that way.) This suggests there may be other shenanigans at work, perhaps compounding the discontinuity issue.

Re: Collision Issue

Posted: Tue Apr 23, 2013 10:14 am
by Blu3
Thanks for your advice Norbo.

Here's a gif of what it looked like when it got stuck: Image
It happened quite rarely but it just didn't feel right for obvious reasons. The cube is just a placeholder and has no physics.
So, a properly constructed mesh
I tried removing this ledge and so far i didn't get stuck anymore. I guess that was the problem causing it.

Image

Thanks again for your quick answer and the great physics engine that is BEPUphysics.