Changeset 503 for trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
- Timestamp:
- 01/05/06 20:41:52 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
r483 r503 1 1 #include "Polygon3.h" 2 #include "Mesh.h"3 2 #include "Mesh.h" 4 3 #include "AxisAlignedBox3.h" 5 4 #include "Ray.h" 5 #include "Triangle3.h" 6 6 7 7 Polygon3::Polygon3(): … … 471 471 return revPoly; 472 472 } 473 474 475 void Polygon3::Triangulate(vector<Triangle3> &triangles) 476 { 477 int i = 1; 478 int j = 0; 479 int k = mVertices.size() - 1; 480 int count = 0; 481 482 while (i < k) 483 { 484 triangles.push_back(Triangle3(mVertices[i], mVertices[j], mVertices[k])); 485 486 if ((count ++) % 2) 487 j = i ++; 488 else 489 j = k --; 490 } 491 }
Note: See TracChangeset
for help on using the changeset viewer.