Changeset 860 for GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
- Timestamp:
- 04/28/06 18:42:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r704 r860 9 9 #include "Mesh.h" 10 10 11 using namespace GtpVisibilityPreprocessor { 12 11 13 #define FATAL Debug 12 14 #define FATAL_ABORT exit(1) … … 54 56 for (it = newpoly.mVertices.begin(); it != it_end; ++ it) 55 57 Include(*it); 58 } 59 60 void 61 AxisAlignedBox3::Include(const PolygonContainer &polys) 62 { 63 PolygonContainer::const_iterator it, it_end = polys.end(); 64 65 for (it = polys.begin(); it != it_end; ++ it) 66 Include(*(*it)); 56 67 } 57 68 … … 2038 2049 2039 2050 2040 void AxisAlignedBox3::AddBoxToMesh(Mesh *mesh) const2051 void IncludeBoxInMesh(const AxisAlignedBox3 &box, Mesh &mesh) 2041 2052 { 2042 2053 // add 6 vertices of the box 2043 int index = (int)mesh ->mVertices.size();2054 int index = (int)mesh.mVertices.size(); 2044 2055 2045 for (int i=0; i < 8; i++)2056 for (int i=0; i < 8; ++ i) 2046 2057 { 2047 2058 Vector3 v; 2048 GetVertex(i, v);2049 mesh ->mVertices.push_back(v);2059 box.GetVertex(i, v); 2060 mesh.mVertices.push_back(v); 2050 2061 } 2051 2062 2052 mesh ->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) );2053 mesh ->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) );2054 mesh ->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) );2063 mesh.AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 2064 mesh.AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 2065 mesh.AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 2055 2066 2056 mesh ->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) );2057 mesh ->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) );2058 mesh ->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) );2067 mesh.AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 2068 mesh.AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 2069 mesh.AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 2059 2070 } 2060 2071 … … 2111 2122 2112 2123 } 2124 2125 }
Note: See TracChangeset
for help on using the changeset viewer.