How to get btShape volume?

irrmich
Posts: 6
Joined: Thu Sep 04, 2014 1:23 pm

How to get btShape volume?

Post by irrmich »

I wish to implement a water with buyoancy using concaveConvexcastDemo code, but i need to calculate object volume, and object mass to use archimed formula. Someone knows?
irrmich
Posts: 6
Joined: Thu Sep 04, 2014 1:23 pm

Re: How to get btShape volume?

Post by irrmich »

Finally, i'm going to aproximate the mesh shape volume using the bounding box of the shape waiting for a better algorithm
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: How to get btShape volume?

Post by drleviathan »

I have some code that can compute the volume, center of mass, and inertia tensor of closed meshes and I've been looking for an excuse to clean it up and submit for public use. I'll try to get around to it, but I don't think I can get to it today.
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: How to get btShape volume?

Post by drleviathan »

I decided to rewrite my mass properties utility, clean up its unit tests and submit it to the public domain. I've attached a tarfile with the code. Alternatively you can download it from my google drive here.

The code will compute the volume, center of mass, and inertia tensor of any closed mesh.
You do not have the required permissions to view the files attached to this post.