source: GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp @ 863

Revision 863, 540 bytes checked in by mattausch, 19 years ago (diff)

working on preprocessor integration
added iv stuff

RevLine 
[544]1#include "Tetrahedron3.h"
2
3
[863]4namespace GtpVisibilityPreprocessor {
[860]5
6
[544]7float Tetrahedron3::GetArea() const
8{
9        float area = 0;
10        for (int i = 0; i < 4; ++ i)
11                area += GetTriangle(i).GetArea();
12
13        return area;
14}
15
16
17float Tetrahedron3::GetVolume() const
18{
19        const Vector3 a = mVertices[2] - mVertices[1];
20        const Vector3 b = mVertices[3] - mVertices[1];
21        const Vector3 c = mVertices[4] - mVertices[1];
22
23        return (1.0f / 6.0f) * fabs(DotProd(a, CrossProd(b, c)));
24}
25
26
27bool Tetrahedron3::Valid() const
28{
29        return true;
[860]30}
31
[544]32}
Note: See TracBrowser for help on using the repository browser.