Line | |
---|
1 | #include "Tetrahedron3.h"
|
---|
2 |
|
---|
3 |
|
---|
4 | using namespace GtpVisibilityPreprocessor {
|
---|
5 |
|
---|
6 |
|
---|
7 | float 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 |
|
---|
17 | float 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 |
|
---|
27 | bool Tetrahedron3::Valid() const
|
---|
28 | {
|
---|
29 | return true;
|
---|
30 | }
|
---|
31 |
|
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.