Non-static Triangle mesh?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

Non-static Triangle mesh?

Post by Danthekilla »

Hey,

Is there is any equivelent for the static triangle mesh, but not static? We know that we can make compound bodies, from various shapes, but we were hoping to be able to load a model in and get a dynamic physics entity from it. We would use a lodded low res model for many of our more detailed objects of course.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Non-static Triangle mesh?

Post by Norbo »

You can create a CompoundBody out of Triangle entities created from loaded vertices/indices.

Of course, the standard disclaimers apply; the inertia tensor calculated for such a shape is a 'shell' (since it has no volume). Collisions can be hard to resolve if a triangle manages to push itself through another entity while its triangle family is on the other side (leading to jitter or getting stuck). It will be slower than an equivalent single entity or simpler CompoundBody. The only way to know if it will work acceptably is to try it and see, but there is an alternative if it doesn't pan out.

By dividing the model into convex pieces, you can create relatively few ConvexHulls bundled into a single CompoundBody. This shape will have a more correct 'solid' inertia tensor, it will have fewer collision oddities, and should be significantly faster.
Post Reply