Any way to do a dynamic triangle mesh?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
bryanedds
Posts: 14
Joined: Tue Jul 13, 2010 6:17 pm

Any way to do a dynamic triangle mesh?

Post by bryanedds »

Static triangle meshes do their job, but how would I do a triangle mesh for a moving entity?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Any way to do a dynamic triangle mesh?

Post by Norbo »

A bunch of triangles could be tossed into a CompoundBody. It has an internal acceleration structure to handle lots of subbodies during collisions, but still, the more of an approximation it is, the better. For example, if two 'meshes' are colliding, it's possible that some of the triangles could penetrate the other shape since they are just hollow shells. That would produce weird looking behavior as it tried to fight its way out.

Creating ConvexHulls out of parts of a mesh and using them in a CompoundBody is another option. The number of convex hulls required would be far lower than the number of triangles required, and your shape would actually have volume instead of being a hollow shell. And of course, there's always the option of creating a CompoundBody of simple primitives like boxes and spheres to approximate the shape.

Dynamic meshes may get another look in the upcoming collision system rewrite. Better static meshes are a high priority, and it should be possible to adapt the same system to dynamic meshes with some extra work.
Post Reply