Changeset 1973 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 01/12/07 23:09:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r1972 r1973 184 184 } 185 185 186 187 188 bool TriangleValid(const Triangle3 &triangle) 189 { 190 /*int i; 191 int good_triangles = 0; 192 int ntriangles = tri.GetSize(); 193 194 for (i = 0; i < ntriangles; i++) { 195 int ti = tri[i]; 196 RTVec3f v[3]; 197 get_triangle(m_tree, v, tri[i]); 198 if ((v[0]-v[1]).Cross(v[0]-v[2]).LengthSquared() <= 0.000001*FLT_EPSILON*FLT_EPSILON) { 199 // v0, v1 & v2 lays on a line (area == 0) 200 tri[i] = -1; 201 continue; 202 } 203 good_triangles++; 204 }*/ 205 206 return false; 207 } 186 208 187 209 bool ObjParser::ParseFile(const string filename, … … 244 266 245 267 LoadTriangles(str, vertices, hashTable, triangles); 246 247 268 vector<Triangle3>::const_iterator tit, tit_end = triangles.end(); 248 269 249 270 for (tit = triangles.begin(); tit != tit_end; ++ tit) 250 271 { 272 if (!TriangleValid(*tit)) 273 continue; 274 251 275 TriangleIntersectable *obj = new TriangleIntersectable(*tit); 252 276 root->mGeometry.push_back(obj);
Note: See TracChangeset
for help on using the changeset viewer.