Changeset 290
- Timestamp:
- 09/19/05 03:47:29 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Plane3.h
r289 r290 48 48 if (signum(dv) == 0) 49 49 { 50 if (coplanar) 51 (*coplanar) = true; 52 50 if (coplanar) (*coplanar) = true; 51 if (t) (*t) = 1; 53 52 return a; 54 53 } 54 55 float u = - Distance(a) / dv; // TODO: could be done more efficiently 55 56 56 float u = - Distance(a) / dv; // TODO: could be done more efficiently 57 //Debug << "t: " << u << ", b - a: " << v << ", norm: " << mNormal << ", dist(a): " << - Distance(a) << ", dv: " << dv << endl; 58 if (coplanar) 59 (*coplanar) = false; 60 61 if (t) 62 (*t) = u; 63 57 if (coplanar) (*coplanar) = false; 58 if (t) (*t) = u; 59 60 //Debug << "t: " << u << ", b - a: " << v << ", norm: " << mNormal << ", dist(a): " << - Distance(a) << ", dv: " << dv << endl; 64 61 //return a - Distance(a) * b / dv + Distance(a) * a / dv; // NOTE: gives better precision than calclulating a + u * v 65 62 return a + u * v; -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
r289 r290 63 63 //-- plane - line intersection 64 64 Vector3 splitPt = partition->FindIntersection(ptA, ptB); 65 Debug << "front split pt " << splitPt << " ptA " << ptA << " ptB " << ptB << " side " << sideB << endl; 65 Debug << "fpg " << splitPt << " side " << partition->Side(splitPt, SIDE_TOLERANCE) << 66 "\nptA " << ptA << " side " << sideA << "\nptB " << ptB << " side " << sideB << " " << Distance(ptB, splitPt) << endl; 66 67 if (!foundSplit || (SqrDistance(splitPt, prevSplitPt) > SIDE_TOLERANCE_SQRD)) 67 68 { -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r289 r290 185 185 Debug << "*************\n"; 186 186 Debug << "initial poly\n" << *poly << endl; 187 //-- split polygon 187 //-- split polygon into front and back part 188 188 poly->Split(&mPlane, front_piece, back_piece); 189 ++ splits; 189 190 ++ splits; // increase number of splits 190 191 191 //Debug << "poly\n" << *poly << "split front piece not valid\n" << *front_piece << endl; 192 //Debug << "poly\n" << *poly << "split back piece not valid\n" << *back_piece << endl; 193 194 if (front_piece->CheckValid()) 192 if (front_piece->mVertices.size() >= 3) // check if polygon still valid 195 193 frontPolys->push_back(front_piece); 196 else 197 DEL_PTR(front_piece); 194 else{ 195 Debug << "poly\n" << *poly << "split front piece not valid\n" << *front_piece << endl; 196 DEL_PTR(front_piece);} 198 197 199 //if (back_piece->CheckValid())198 if (back_piece->mVertices.size() >= 3) // check if polygon still valid 200 199 backPolys->push_back(back_piece); 201 //else 202 // DEL_PTR(back_piece); 200 else{ 201 Debug << "poly\n" << *poly << "split back piece not valid\n" << *back_piece << endl; 202 DEL_PTR(back_piece);} 203 203 204 Debug << "*************\n"; 204 205 #ifdef _DEBUG … … 518 519 // copy view cell meshes into one big polygon soup 519 520 PolygonContainer *polys = new PolygonContainer(); 520 Copy2PolygonSoup(viewCells, *polys);521 mStat.polys = Copy2PolygonSoup(viewCells, *polys); 521 522 522 523 // construct tree from viewcell polygons … … 626 627 &coincident); 627 628 628 if (coincident.size() == 0) 629 { 630 Debug << "size is zero at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 631 if (frontPolys) Debug << "front poly: " << *frontPolys->back() << endl; 629 if ((backPolys->size() == 0) && (coincident.size() > 1)) 630 { 631 Debug << "WARNING: size " << coincident.size() << " at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 632 for (int i=0; i<coincident.size();++i) 633 Debug << "coincident " << i << " vc " << coincident[i]->mParent << endl; 632 634 } 633 635 //Debug << "coincident size: " << coincident.size() << endl;
Note: See TracChangeset
for help on using the changeset viewer.