The moment of inertia for a geom should be calculated on the basis of its local center of reference and not of the center of the world. dMassSetTrimesh brought us weird simulation behaviour when simply adding and removing Geoms of a Body while at different world positions (which was the only difference between those geoms) when calculating the moment of inertia. I believe the reason is that dMassSetTrimesh uses FetchTriangleCount which calls dGeomGetPosition and dGeomGetRotation which means that world transform is used because the position of its attached body gets added to the result. I was able to fix the wrong behaviour by using dGeomGetOffsetPosition and dGeomGetOffsetRotation in FetchTriangleCount.
Log in to post a comment.