Hi all,

I'm dealing with collisions of nonconvex rigid bodies, using btGImpactMeshShape.

BtGImpactMeshShape expects the origin to be the Center of Mass.

I have some models which don't meet this requirment, but I would like to use them.

Is there a function in bullet to compute the center of mass(I haven't found one) or do you know any other tools to compute the center of mass of surface meshes?

Thanks a lot!

## Center of mass computation for btGImpactMeshShape

### Re: Center of mass computation for btGImpactMeshShape

There is btRigidBody::getCenterOfMassPosition() you can try.

I remember having done this, it should be possible.

HTH,

Moose

I remember having done this, it should be possible.

HTH,

Moose

### Re: Center of mass computation for btGImpactMeshShape

Thanks for your respond.

But btRigidBody::getCenterOfMassPosition() only works if the Body is initialized with the center of mass in the origin.

Otherwise it assumes to initial origin to be the center of mass and returns the current position of this point, so this isn't a solution to my issue.

This topic was already discussed in http://www.bulletphysics.org/Bullet/php ... f=9&t=2209 , so it seems that I need to compute the center of mass by hand.

But btRigidBody::getCenterOfMassPosition() only works if the Body is initialized with the center of mass in the origin.

Otherwise it assumes to initial origin to be the center of mass and returns the current position of this point, so this isn't a solution to my issue.

This topic was already discussed in http://www.bulletphysics.org/Bullet/php ... f=9&t=2209 , so it seems that I need to compute the center of mass by hand.