Calculate volume for convex shapes?
Posted: Sun Apr 23, 2017 4:18 am
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.
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.