Center of mass computation for btGImpactMeshShape

Post Reply
keev
Posts: 3
Joined: Mon Mar 17, 2014 11:17 am

Center of mass computation for btGImpactMeshShape

Post by keev »

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!
Moose
Posts: 31
Joined: Mon Nov 04, 2013 10:58 am

Re: Center of mass computation for btGImpactMeshShape

Post by Moose »

There is btRigidBody::getCenterOfMassPosition() you can try.
I remember having done this, it should be possible.

HTH,
Moose
keev
Posts: 3
Joined: Mon Mar 17, 2014 11:17 am

Re: Center of mass computation for btGImpactMeshShape

Post by keev »

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.
Post Reply