#include "Tetrahedron3.h" namespace GtpVisibilityPreprocessor { float Tetrahedron3::GetArea() const { float area = 0; for (int i = 0; i < 4; ++ i) area += GetTriangle(i).GetArea(); return area; } float Tetrahedron3::GetVolume() const { const Vector3 a = mVertices[2] - mVertices[1]; const Vector3 b = mVertices[3] - mVertices[1]; const Vector3 c = mVertices[4] - mVertices[1]; return (1.0f / 6.0f) * fabs(DotProd(a, CrossProd(b, c))); } bool Tetrahedron3::Valid() const { return true; } }