Revision 863,
540 bytes
checked in by mattausch, 19 years ago
(diff) |
working on preprocessor integration
added iv stuff
|
Rev | Line | |
---|
[544] | 1 | #include "Tetrahedron3.h"
|
---|
| 2 |
|
---|
| 3 |
|
---|
[863] | 4 | namespace GtpVisibilityPreprocessor {
|
---|
[860] | 5 |
|
---|
| 6 |
|
---|
[544] | 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;
|
---|
[860] | 30 | }
|
---|
| 31 |
|
---|
[544] | 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.