Center of gravity

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
templar_vii
Posts: 17
Joined: Wed Nov 06, 2013 2:56 pm

Center of gravity

Post by templar_vii »

I'd like to calculate the center of gravity.

I already found the calculation of the center of mass:
viewtopic.php?f=4&t=2067&p=12148&hilit= ... ity#p12148

Unfortunately my entity has no mass, nor a volume.
It's just a collection of plane MobileMeshes.

So I thought I could sum the surfaces instead to sum the masses.
But there is no Surface property on the entity.
Does anybody know how I could calculate the surface of an entity?

If there's no way, my workaround would be to sum all triangles before creating the MobileMesh.

Many thanks for all helps!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Center of gravity

Post by Norbo »

There is indeed no precomputed surface area available to use as a weight in the weighted average, since the engine never makes use of it. If you wanted to do it that way, compute the area of each triangle individually beforehand.

You may find, however, that extremely simple arbitrary weights do the job quite well. "Correctness" is often a very fuzzy thing when it comes to human perception, especially with rotational behavior and mass distribution.
Post Reply