I see two workarounds so far:
- Place a sphere or cube mesh as root component in actor’s hierarchy. Place rest of the objects as it’s children so they will be attached.
Pros: It works and allows to shift center of mass if needed by offsetting it in the root, which is now always located at the actor’s origin.
Cons: I’ve experienced significant difference in stability between sphere component (available by default as actor component, used for bounds and etc.) and custom cube imported from external application. Somehow the shape or a size of the objects influences stability. The mass was suppose to be the same and was simply scaled with parameter. Collision has to be processed by a child mesh, so far I didn’t figure out the recipe of how it can be done.
- Triangulate center of mass using several AddForceInLocation forces and resulting angular velocity.
Pros: should work with any mesh as a root body.
Cons: Precision can be an issue. Triangulation should be done without any kind of velocity dumping on body but simulation would most likely need it. Have zero idea how to do it in constructor as physics simulation most likely won’t be running there.
Non of these are the proper solutions in long run. Ability to set/get center of mass, which is I believe just one of the properties of PhysiX object, should be the proper way to handle this. I’m not an expert in physics simulation and might be completely wrong here. Response from developers on this matter is greatly appreciated.