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!
Center of gravity
Re: Center of gravity
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.
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.