• 3D
  • How can I change the centre of mass in Bullet while connected to a joint?

One of my robots is composed of three physics bodies connected together with hinge joints. The lower body contains two meshes, one of which is styled like the inner part of a piston and is supposed to slide out of the other mesh - while I know exactly how I want to do this specifically, it should also result in the centre of mass being much lower down in the body, which is a bit more complicated.

I can't work out how to do this because if I tried to move the rigid body manually, the position difference would be automatically corrected by the hinge, and I can't switch to GodotPhysics (which calculates the centre differently) because it breaks so many aspects of my game if I turn it on. Does anyone know some way I could change the centre of mass of the body while attached to the joint?

Maybe try offsetting the mesh and collision shape, so they are in the correct position relative to the joint while also allowing the center of mass to be correct? I think the center of mass in Godot is the center of the RigidBody node, at least with Bullet.

7 days later

@TwistedTwigleg said: Maybe try offsetting the mesh and collision shape, so they are in the correct position relative to the joint while also allowing the center of mass to be correct? I think the center of mass in Godot is the center of the RigidBody node, at least with Bullet.

Thanks, I've thought of a solution now but this might have helped if I'd read it. For some reason the forum didn't send me a notification email like it usually does, so I wasn't aware this had been replied to );

I'm not marking anything as a solution yet because I've only found one way of doing this and it's really not ideal - I have to frequently disconnect the joint, move it to a different position and reconnect it with its nodes. I'll update the post if I find something better.

a month later