Any way to do a dynamic triangle mesh?
Any way to do a dynamic triangle mesh?
Static triangle meshes do their job, but how would I do a triangle mesh for a moving entity?
Re: Any way to do a dynamic triangle mesh?
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.
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.