I want to implement buoyancy into my program, but I've run into a bit of a problem.
I already have all of the algorithms in place, but to calculate an accurate buoyancy force I need to know the total volume of the shape for the collision object in the liquid, as well as the volume of the part of the shape that is submerged.
I can do this fine with triangle geometry, but I'm not sure what to do about convex shapes with point-clouds. I could triangulate the point-cloud offline, but that's not guaranteed to give me the same 'shape' as bullet would use.
Is there another way of doing this?
I can't find anything in bullet that could help me here, but maybe I'm missing something.
Calculate volume for convex shapes?
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Calculate volume for convex shapes?
I don't think there is a Bullet utility for that. The good news is that you probably don't need high accuracy to get results that are "good enough" for the human eye. Unless you're working on a high-accuracy application then use an approximate method.
-
- Posts: 41
- Joined: Fri Apr 29, 2016 2:41 pm
Re: Calculate volume for convex shapes?
As a guestimate you could try the bbox as well as the bounding sphere for an approximation.