Calculating the volume of a triangular mesh?
This site has both code and theoretical descriptions. Look for items that mention "polyhedral mass properties". They typically live in the "physics" sections of the site.