- Timestamp:
- 11/17/05 18:47:53 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r419 r420 61 61 ObjectContainer objects; 62 62 63 switch ( BspTree::sConstructionMethod)63 switch (mBspTree->mConstructionMethod) 64 64 { 65 65 case BspTree::FROM_INPUT_VIEW_CELLS: … … 181 181 } 182 182 183 if (ViewCell::sHierarchy == ViewCell::BSP)183 switch(ViewCell::sHierarchy) 184 184 { 185 // cast ray to BSP tree to get intersection with view cells 186 if (mBspTree) 187 { 188 mBspTree->CastRay(ray); 189 190 if (object) 191 sampleContributions += AddObjectSamples(object, ray); 192 193 if (!ray.intersections.empty()) // second intersection found 194 { 195 sampleContributions += 196 AddObjectSamples(ray.intersections[0].mObject, ray); 197 } 198 } 199 } 200 else { 201 if (ray.kdLeaves.size()) { 185 case ViewCell::BSP: 186 187 //-- cast ray to BSP tree to get intersection with view cells 188 if (!mBspTree) 189 break; 190 191 mBspTree->CastRay(ray); 192 193 if (object) 194 sampleContributions += AddObjectSamples(object, ray); 195 196 if (!ray.intersections.empty()) // second intersection found 197 { 198 sampleContributions += 199 AddObjectSamples(ray.intersections[0].mObject, ray); 200 } 201 break; 202 case ViewCell::KD: 203 if (ray.kdLeaves.size()) 204 { 202 205 Intersectable *terminator = 203 206 ray.intersections.size() ? ray.intersections[0].mObject: NULL; 204 207 205 208 sampleContributions += AddNodeSamples(ray, 206 object, 207 terminator); 208 } 209 } 210 209 object, 210 terminator); 211 } 212 break; 213 case ViewCell::VSP: 214 // TODO: 215 break; 216 default: 217 Debug << "Should never come here" << endl; 218 break; 219 } 220 211 221 return sampleContributions; 212 222 } … … 573 583 if (exporter) 574 584 { 585 exporter->SetWireframe(); 575 586 exporter->ExportBspLeaves(*mBspTree, stat.maxPvs); 576 587 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 588 589 if (1) // export scene geometry 590 { 591 Material m;//= RandomMaterial(); 592 m.mDiffuseColor = RgbColor(0, 1, 0); 593 exporter->SetForcedMaterial(m); 594 exporter->SetWireframe(); 595 596 for (int j = 0; j < objects.size(); ++ j) 597 exporter->ExportIntersectable(objects[j]); 598 } 599 577 600 delete exporter; 578 601 } … … 756 779 if (!mBspTree) 757 780 { 758 if ((BspTree:: sConstructionMethod == BspTree::FROM_RAYS) &&781 if ((BspTree::mConstructionMethod == BspTree::FROM_RAYS) && 759 782 ((int)mSampleRays.size() < mBspConstructionSamples)) 760 783 { … … 866 889 outRays.push_back(mSampleRays[i]); 867 890 } 868 if (BspTree:: sConstructionMethod == BspTree::FROM_RAYS)891 if (BspTree::mConstructionMethod == BspTree::FROM_RAYS) 869 892 { 870 893 // export rays
Note: See TracChangeset
for help on using the changeset viewer.