Looking for some clarification on the expected behaviour of welded BodyInstances

Watcha. Our game has required the use of welded, compound meshes to support construction of in-game assets from individual parts. To achieve this, we’ve started using the disabled BodyInstance welding code to merge colliders.

This seems to work and is providing correct collisions on simulated physics objects, however the compound objects are non-symmetrical and exhibit odd behaviour when torque is applied to the center of mass.

Adding yaw results in both yaw and roll due to the asymmetry. I was under the impression that with a diagonal vector-usage of an inertia tensor, such responses couldn’t happen, though I admit my physics knowledge is pretty ropey. Is this expected behaviour?

I’ve seen that welding is going to be officially supported when attaching actors in the future, so we’re hoping to use that method when it becomes available. Knowing whether this yaw-causing-roll behaviour is expected would help us decide if it’s worth investing time resolving the issue now or if we should wait for the welding code to be officially supported if you think that’s likely to resolve the matter.

Hi,

This code is very experimental at this stage, but it’s definitely something we’re looking to add. I would have expected the COM to be correctly recalculated as the call to FBodyInstance::Weld calls UpdateMassProperties()

From my initial tests the objects seemed to show the right mass distribution, but I have not tested this with applying torque like you say.

I’ve been working on other features for the moment so I haven’t looked at this code very recently, but I would expect that when we officially release this it will have to fix the issue you’re describing. Having said that, if you spend time investigating this I’d certainly appreciate it!

Hi Ori,

I appreciate the response. Our game doesn’t actually need for us to describe masses completely correctly (we’re bodging elements for the feel of the game), so I ended up exposing the option to set the inertia tensor manually and provided it with identical values in each axis, which resolved our rotation issues at the cost of being mathematically unconscionable.

Thanks again for the response!