- Timestamp:
- 12/14/05 19:38:39 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r465 r466 67 67 } 68 68 69 void ViewCellsManager::ComputeSampleContributions(const RayContainer &rays, 70 int &sampleContributions, 71 int &contributingSamples, 72 const bool castRays) 73 { 74 // view cells not yet constructed 75 if (!ViewCellsConstructed()) 76 return; 77 78 RayContainer::const_iterator it, it_end = rays.end(); 79 80 sampleContributions = 0; 81 contributingSamples = 0; 82 83 for (it = rays.begin(); it != it_end; ++ it) 84 { 85 sampleContributions += ComputeSampleContributions(*(*it), castRays); 86 contributingSamples += sampleContributions > 0; 87 } 69 void 70 ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays 71 ) 72 { 73 // view cells not yet constructed 74 if (!ViewCellsConstructed()) 75 return; 76 77 VssRayContainer::const_iterator it, it_end = rays.end(); 78 for (it = rays.begin(); it != it_end; ++ it) { 79 ComputeSampleContributions(*(*it)); 80 } 88 81 } 89 82 … … 277 270 } 278 271 279 int BspViewCellsManager::ComputeSampleContributions(Ray &ray, const bool castRay) 280 { 281 // view cells not yet constructed 282 if (!ViewCellsConstructed()) 283 return 0; 284 285 int contributingSamples = 0; 286 287 if (castRay) 288 mBspTree->CastRay(ray); 289 290 //if (mBspTree->bspIntersections.empty()) return 0; 291 292 Intersectable *tObject = 293 !ray.intersections.empty() ? ray.intersections[0].mObject : NULL; 294 295 Intersectable *sObject = ray.sourceObject.mObject; 296 297 if (sObject || tObject) 298 { 299 // object can be seen from the view cell => add to view cell pvs 300 for (int j = 0; j < (int)ray.bspIntersections.size(); ++ j) 301 { 302 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 303 304 // if ray not outside of view space 305 if (leaf->GetViewCell() != mBspTree->GetRootCell()) 306 { 307 if (sObject) 308 { 309 contributingSamples += 310 leaf->GetViewCell()->GetPvs().AddSample(sObject); 311 } 312 313 if (tObject) 314 { 315 contributingSamples += 316 leaf->GetViewCell()->GetPvs().AddSample(tObject); 317 } 318 } 319 } 320 } 321 322 // rays passing through this viewcell 323 if (0) 324 for (int j = 1; j < ((int)ray.bspIntersections.size() - 1); ++ j) 325 { 326 BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 327 328 if (leaf->GetViewCell() != mBspTree->GetRootCell()) 329 leaf->GetViewCell()-> 330 AddPassingRay(ray, contributingSamples ? 1 : 0); 331 } 332 333 return contributingSamples; 334 } 335 336 int BspViewCellsManager::PostProcess(const ObjectContainer &objects, 337 const RayContainer &rays) 338 { 339 if (!ViewCellsConstructed()) 272 void 273 ViewCellsManager::ComputeSampleContributions(VssRay &ray) 274 { 275 276 ViewCellContainer viewcells; 277 278 CastLineSegment(ray.mOrigin, 279 ray.mTermination, 280 viewcells 281 ); 282 283 ViewCellContainer::const_iterator it = viewcells.begin(); 284 for (; it != viewcells.end(); ++it) { 285 ViewCell *viewcell = *it; 286 287 // if ray not outside of view space 288 float contribution; 289 bool added = 290 viewcell->GetPvs().AddSample(ray.mTerminationObject, 291 contribution 292 ); 293 if (added) 294 ray.mPvsContribution++; 295 296 ray.mRelativePvsContribution += contribution; 297 } 298 299 } 300 301 int 302 BspViewCellsManager::CastLineSegment(const Vector3 &origin, 303 const Vector3 &termination, 304 ViewCellContainer &viewcells 305 ) 306 { 307 return mBspTree->CastLineSegment(origin, termination, viewcells); 308 } 309 310 int 311 BspViewCellsManager::PostProcess(const ObjectContainer &objects, 312 const VssRayContainer &rays) 313 { 314 if (!ViewCellsConstructed()) 340 315 { 341 316 Debug << "view cells not constructed" << endl; … … 391 366 long startTime = GetTime(); 392 367 368 // $$JB we do not have connectivity information from the ray in the moment 369 // perhaps we could recast the rays or rember the cells traversed inside the 370 // vssray (which would on other hand create some overhead) 393 371 //-- merge or subdivide view cells 394 372 int merged = 0; 373 #if 0 395 374 396 375 RayContainer::const_iterator rit, rit_end = rays.end(); … … 427 406 } 428 407 } 429 408 #endif 430 409 //-- stats and visualizations 431 410 cout << "finished" << endl; … … 443 422 444 423 void BspViewCellsManager::Visualize(const ObjectContainer &objects, 445 const RayContainer &sampleRays)446 { 447 448 449 450 451 452 453 454 455 { 456 457 458 459 460 { 461 462 463 464 } 465 466 424 const VssRayContainer &sampleRays) 425 { 426 if (!ViewCellsConstructed()) 427 return; 428 429 //-- recount pvs 430 ViewCellsStatistics vcStats; 431 mBspTree->EvaluateViewCellsStats(vcStats); 432 433 if (1) // export view cells 434 { 435 cout << "exporting view cells after merge ... "; 436 Exporter *exporter = Exporter::GetExporter("merged_view_cells.x3d"); 437 438 if (exporter) 439 { 440 exporter->ExportBspViewCellPartition(*mBspTree, vcStats.maxPvs); 441 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 442 delete exporter; 443 } 444 445 cout << "finished" << endl; 467 446 } 468 469 470 471 472 473 474 { 475 476 477 478 } 479 480 447 448 //-- visualization of the BSP splits 449 bool exportSplits = false; 450 environment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 451 452 if (exportSplits) 453 { 454 cout << "exporting splits ... "; 455 ExportSplits(objects, sampleRays); 456 cout << "finished" << endl; 457 } 458 459 ExportBspPvs(objects, sampleRays); 481 460 } 482 461 … … 488 467 489 468 void BspViewCellsManager::ExportSplits(const ObjectContainer &objects, 490 const RayContainer &sampleRays)469 const VssRayContainer &sampleRays) 491 470 { 492 471 Exporter *exporter = Exporter::GetExporter("bsp_splits.x3d"); … … 510 489 if (0) 511 490 { 512 RayContainer outRays; 513 514 int raysSize = min((int)sampleRays.size(), mVisualizationSamples); 515 516 for (int i = 0; i < raysSize; ++ i) 517 { 518 // only rays piercing geometry 519 if (!sampleRays[i]->intersections.empty()) 520 outRays.push_back(sampleRays[i]); 521 } 522 523 // export rays 524 exporter->ExportRays(outRays, 1000, RgbColor(1, 1, 0)); 525 } 526 491 VssRayContainer outRays; 492 493 int raysSize = min((int)sampleRays.size(), mVisualizationSamples); 494 495 for (int i = 0; i < raysSize; ++ i) 496 { 497 // only rays piercing geometry 498 outRays.push_back(sampleRays[i]); 499 } 500 501 // export rays 502 exporter->ExportRays(outRays, RgbColor(1, 1, 0)); 503 } 504 527 505 if (0) 528 529 506 exporter->ExportGeometry(objects); 507 530 508 delete exporter; 531 509 } … … 533 511 534 512 void BspViewCellsManager::ExportBspPvs(const ObjectContainer &objects, 535 const RayContainer &sampleRays) 536 { 537 const int leafOut = 10; 538 539 ViewCell::NewMail(); 540 541 //-- some rays for output 542 const int raysOut = min((int)sampleRays.size(), mVisualizationSamples); 543 Debug << "visualization using " << raysOut << " samples" << endl; 544 545 546 if (1) 547 { 548 //-- some random view cells and rays for output 549 vector<BspLeaf *> bspLeaves; 550 551 for (int i = 0; i < leafOut; ++ i) 552 bspLeaves.push_back(mBspTree->GetRandomLeaf()); 553 554 for (int i = 0; i < bspLeaves.size(); ++ i) 555 { 556 BspLeaf *leaf = bspLeaves[i]; 557 558 RayContainer vcRays; 559 560 cout << "creating output for view cell " << i << " ... "; 561 562 // check whether we can add the current ray to the output rays 563 for (int k = 0; k < raysOut; ++ k) 564 { 565 Ray *ray = sampleRays[k]; 566 567 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) 513 const VssRayContainer &sampleRays) 514 { 515 const int leafOut = 10; 516 517 ViewCell::NewMail(); 518 519 //-- some rays for output 520 const int raysOut = min((int)sampleRays.size(), mVisualizationSamples); 521 Debug << "visualization using " << raysOut << " samples" << endl; 522 523 //$$ JB 524 #if 0 525 526 if (1) 527 { 528 //-- some random view cells and rays for output 529 vector<BspLeaf *> bspLeaves; 530 531 for (int i = 0; i < leafOut; ++ i) 532 bspLeaves.push_back(mBspTree->GetRandomLeaf()); 533 534 535 for (int i = 0; i < bspLeaves.size(); ++ i) 536 { 537 BspLeaf *leaf = bspLeaves[i]; 538 539 RayContainer vcRays; 540 541 cout << "creating output for view cell " << i << " ... "; 542 543 // check whether we can add the current ray to the output rays 544 for (int k = 0; k < raysOut; ++ k) 545 { 546 Ray *ray = sampleRays[k]; 547 548 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) 568 549 { 569 570 571 550 BspLeaf *leaf2 = ray->bspIntersections[j].mLeaf; 551 552 if (leaf->GetViewCell() == leaf2->GetViewCell()) 572 553 { 573 554 vcRays.push_back(ray); 574 555 } 575 556 } 576 557 } 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 { 599 600 601 602 558 559 Intersectable::NewMail(); 560 561 BspViewCell *vc = dynamic_cast<BspViewCell *>(leaf->GetViewCell()); 562 563 //bspLeaves[j]->Mail(); 564 char s[64]; sprintf(s, "bsp-pvs%04d.x3d", i); 565 566 Exporter *exporter = Exporter::GetExporter(s); 567 exporter->SetFilled(); 568 569 exporter->SetWireframe(); 570 //exporter->SetFilled(); 571 572 Material m;//= RandomMaterial(); 573 m.mDiffuseColor = RgbColor(1, 1, 0); 574 exporter->SetForcedMaterial(m); 575 576 if (vc->GetMesh()) 577 exporter->ExportViewCell(vc); 578 else 579 { 580 PolygonContainer vcGeom; 581 // export view cell geometry 582 mBspTree->ConstructGeometry(vc, vcGeom); 583 exporter->ExportPolygons(vcGeom); 603 584 CLEAR_CONTAINER(vcGeom); 604 585 } 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 { 622 623 586 587 Debug << i << ": pvs size=" << (int)vc->GetPvs().GetSize() 588 << ", piercing rays=" << (int)vcRays.size() << endl; 589 590 // export rays piercing this view cell 591 exporter->ExportRays(vcRays, 1000, RgbColor(0, 1, 0)); 592 593 m.mDiffuseColor = RgbColor(1, 0, 0); 594 exporter->SetForcedMaterial(m); 595 596 // exporter->SetWireframe(); 597 exporter->SetFilled(); 598 599 ViewCellPvsMap::iterator it, it_end = vc->GetPvs().mEntries.end(); 600 // output PVS of view cell 601 for (it = vc->GetPvs().mEntries.begin(); it != it_end; ++ it) 602 { 603 Intersectable *intersect = (*it).first; 604 if (!intersect->Mailed()) 624 605 { 625 626 606 exporter->ExportIntersectable(intersect); 607 intersect->Mail(); 627 608 } 628 609 } 629 630 631 632 } 633 } 634 635 { 636 637 638 639 640 641 642 643 644 645 { 646 610 611 DEL_PTR(exporter); 612 cout << "finished" << endl; 613 } 614 } 615 else 616 { 617 ViewCellContainer viewCells; 618 RayContainer vcRays; 619 620 mBspTree->CollectViewCells(viewCells); 621 stable_sort(viewCells.begin(), viewCells.end(), vc_gt); 622 623 int limit = min(leafOut, (int)viewCells.size()); 624 625 for (int i = 0; i < limit; ++ i) 626 { 627 cout << "creating output for view cell " << i << " ... "; 647 628 648 629 Intersectable::NewMail(); … … 721 702 } 722 703 } 704 #endif 723 705 } 724 706 … … 822 804 823 805 int KdViewCellsManager::PostProcess(const ObjectContainer &objects, 824 const RayContainer &rays)806 const VssRayContainer &rays) 825 807 { 826 808 return 0; … … 828 810 829 811 void KdViewCellsManager::Visualize(const ObjectContainer &objects, 830 const RayContainer &sampleRays)812 const VssRayContainer &sampleRays) 831 813 { 832 814 if (!ViewCellsConstructed()) … … 837 819 int limit = min(mVisualizationSamples, (int)sampleRays.size()); 838 820 839 RayContainer *rays = newRayContainer[pvsOut];821 VssRayContainer *rays = new VssRayContainer[pvsOut]; 840 822 841 823 for (int i = 0; i < limit; ++ i) 842 824 { 843 Ray *ray = sampleRays[i]; 844 845 if (!ray->intersections.empty()) 846 { 847 // check whether we can add this to the rays 848 for (int j = 0; j < pvsOut; j++) 849 { 850 if (objects[j] == ray->intersections[0].mObject) 851 { 852 rays[j].push_back(ray); 853 } 854 } 855 } 856 } 825 VssRay *ray = sampleRays[i]; 826 827 // check whether we can add this to the rays 828 for (int j = 0; j < pvsOut; j++) 829 { 830 if (objects[j] == ray->mTerminationObject) 831 { 832 rays[j].push_back(ray); 833 } 834 } 835 } 836 857 837 858 838 bool exportRays = false; 859 839 if (exportRays) { 860 840 Exporter *exporter = NULL; 861 841 exporter = Exporter::GetExporter("sample-rays.x3d"); 862 842 exporter->SetWireframe(); … … 864 844 865 845 for (i=0; i < pvsOut; i++) 866 exporter->ExportRays(rays[i], 1000,RgbColor(1, 0, 0));846 exporter->ExportRays(rays[i], RgbColor(1, 0, 0)); 867 847 exporter->SetFilled(); 868 848 … … 893 873 } 894 874 895 exporter->ExportRays(rays[k], 1000,RgbColor(0, 1, 0));875 exporter->ExportRays(rays[k], RgbColor(0, 1, 0)); 896 876 exporter->SetFilled(); 897 877 … … 914 894 } 915 895 916 int KdViewCellsManager::ComputeSampleContributions(Ray &ray, const bool castRay)917 {918 // view cells not yet constructed919 if (!ViewCellsConstructed())920 return 0;921 922 if (castRay)923 mKdTree->CastRay(ray);924 925 if (ray.kdLeaves.empty())926 return 0;927 928 Intersectable *tObject =929 !ray.intersections.empty() ? ray.intersections[0].mObject : NULL;930 931 Intersectable *sObject =932 ray.sourceObject.mObject;933 934 int contributingSamples = 0;935 936 int objects = 0;937 938 if (sObject)939 objects++;940 if (tObject)941 objects++;942 943 for (int j = 1; j < ((int)ray.kdLeaves.size() - 1); ++ j)944 {945 ray.kdLeaves[j]->AddPassingRay2(ray, objects,946 (int)ray.kdLeaves.size());947 }948 949 if (!objects)950 return 0;951 952 for (int j=0; j < ray.kdLeaves.size(); j++)953 {954 KdNode *node = GetNodeForPvs(ray.kdLeaves[j]);955 956 if (sObject)957 contributingSamples += sObject->mKdPvs.AddSample(node);958 if (tObject)959 contributingSamples += tObject->mKdPvs.AddSample(node);960 }961 962 return contributingSamples;963 }964 896 965 897 … … 976 908 void KdViewCellsManager::PrintStatistics(ostream &s) const 977 909 { 910 } 911 912 913 int 914 KdViewCellsManager::CastLineSegment(const Vector3 &origin, 915 const Vector3 &termination, 916 ViewCellContainer &viewcells 917 ) 918 { 919 920 return 0; 978 921 } 979 922 … … 1031 974 } 1032 975 1033 int VspKdViewCellsManager::ComputeSampleContributions(Ray &ray, const bool castRay) 1034 { 1035 // view cells not yet constructed 976 977 ViewCell *VspKdViewCellsManager::GenerateViewCell(Mesh *mesh) const 978 { 979 return new VspKdViewCell(mesh); 980 } 981 982 int VspKdViewCellsManager::PostProcess(const ObjectContainer &objects, 983 const VssRayContainer &rays) 984 { 1036 985 if (!ViewCellsConstructed()) 1037 986 return 0; 1038 987 1039 // if (castRay)1040 // mVspKdTree->CastRay(ray);1041 1042 int sampleContributions = 0;1043 1044 return sampleContributions;1045 }1046 1047 ViewCell *VspKdViewCellsManager::GenerateViewCell(Mesh *mesh) const1048 {1049 return new VspKdViewCell(mesh);1050 }1051 1052 int VspKdViewCellsManager::PostProcess(const ObjectContainer &objects,1053 const RayContainer &rays)1054 {1055 if (!ViewCellsConstructed())1056 return 0;1057 1058 988 return mVspKdTree->MergeLeaves(); 1059 989 } 1060 990 1061 991 void VspKdViewCellsManager::Visualize(const ObjectContainer &objects, 1062 const RayContainer &sampleRays)992 const VssRayContainer &sampleRays) 1063 993 { 1064 994 if (!ViewCellsConstructed()) … … 1079 1009 1080 1010 if (exportRays) 1081 {1011 { 1082 1012 int raysSize = 2000; 1083 1013 float prob = raysSize / (float)sampleRays.size(); … … 1085 1015 exporter->SetWireframe(); 1086 1016 1087 RayContainer rays;1017 VssRayContainer rays; 1088 1018 1089 1019 for (int i = 0; i < sampleRays.size(); ++ i) … … 1093 1023 } 1094 1024 1095 exporter->ExportRays(rays, 1000,RgbColor(1, 0, 0));1025 exporter->ExportRays(rays, RgbColor(1, 0, 0)); 1096 1026 } 1097 1027 … … 1165 1095 exporter->SetWireframe(); 1166 1096 1167 RayContainer rays;1097 VssRayContainer rays; 1168 1098 1169 1099 for (int i = 0; i < sampleRays.size(); ++ i) 1170 1100 { 1171 1172 1173 } 1174 exporter->ExportRays(rays, 1000,RgbColor(1, 0, 0));1101 if (RandomValue(0,1) < prob) 1102 rays.push_back(sampleRays[i]); 1103 } 1104 exporter->ExportRays(rays, RgbColor(1, 0, 0)); 1175 1105 } 1176 1106 … … 1191 1121 } 1192 1122 1123 1124 int 1125 VspKdViewCellsManager::CastLineSegment(const Vector3 &origin, 1126 const Vector3 &termination, 1127 ViewCellContainer &viewcells 1128 ) 1129 { 1130 1131 return 0; 1132 } 1193 1133 1194 1134 /**********************************************************************/ … … 1252 1192 } 1253 1193 1254 int VspBspViewCellsManager::ComputeSampleContributions(Ray &ray, const bool castRay)1255 {1256 // view cells not yet constructed1257 if (!ViewCellsConstructed())1258 return 0;1259 1260 int contributingSamples = 0;1261 1262 if (castRay)1263 mVspBspTree->CastRay(ray);1264 1265 Intersectable *tObject =1266 !ray.intersections.empty() ? ray.intersections[0].mObject : NULL;1267 1268 Intersectable *sObject = ray.sourceObject.mObject;1269 1270 if (sObject || tObject)1271 {1272 // object can be seen from the view cell => add to view cell pvs1273 for (int j = 0; j < (int)ray.bspIntersections.size(); ++ j)1274 {1275 BspLeaf *leaf = ray.bspIntersections[j].mLeaf;1276 1277 // if ray not in unbounded space1278 if (leaf->GetViewCell() != mVspBspTree->GetRootCell())1279 {1280 if (sObject)1281 {1282 contributingSamples +=1283 leaf->GetViewCell()->GetPvs().AddSample(sObject);1284 }1285 1286 if (tObject)1287 {1288 contributingSamples +=1289 leaf->GetViewCell()->GetPvs().AddSample(tObject);1290 }1291 }1292 }1293 }1294 1295 // rays passing through this viewcell1296 if (0)1297 for (int j = 1; j < ((int)ray.bspIntersections.size() - 1); ++ j)1298 {1299 BspLeaf *leaf = ray.bspIntersections[j].mLeaf;1300 1301 if (leaf->GetViewCell() != mVspBspTree->GetRootCell())1302 leaf->GetViewCell()->1303 AddPassingRay(ray, contributingSamples ? 1 : 0);1304 }1305 1306 return contributingSamples;1307 }1308 1194 1309 1195 int VspBspViewCellsManager::PostProcess(const ObjectContainer &objects, 1310 const RayContainer &rays)1196 const VssRayContainer &rays) 1311 1197 { 1312 1198 if (!ViewCellsConstructed()) … … 1356 1242 1357 1243 1244 // $$JB we do not have connectivity information from the ray in the moment 1245 // perhaps we could recast the rays or rember the cells traversed inside the 1246 // vssray (which would on other hand create some overhead) 1358 1247 //-- merge or subdivide view cells 1359 1248 int merged = 0; 1249 #if 0 1360 1250 1361 1251 RayContainer::const_iterator rit, rit_end = rays.end(); … … 1366 1256 for (int i = 0; i < limit; ++ i) 1367 1257 { 1368 1369 1370 1371 1372 1373 1374 1375 1258 VssRay *ray = rays[i]; 1259 1260 // traverse leaves stored in the rays and compare and merge consecutive 1261 // leaves (i.e., the neighbors in the tree) 1262 if (ray->bspIntersections.size() < 2) 1263 continue; 1264 1265 iit = ray->bspIntersections.begin(); 1376 1266 1377 1267 BspLeaf *previousLeaf = (*iit).mLeaf; … … 1392 1282 } 1393 1283 } 1394 1284 #endif 1395 1285 //-- stats and visualizations 1396 1286 cout << "finished" << endl; … … 1409 1299 1410 1300 void VspBspViewCellsManager::Visualize(const ObjectContainer &objects, 1411 const RayContainer &sampleRays)1301 const VssRayContainer &sampleRays) 1412 1302 { 1413 1303 if (!ViewCellsConstructed()) … … 1448 1338 1449 1339 void VspBspViewCellsManager::ExportSplits(const ObjectContainer &objects, 1450 const RayContainer &sampleRays)1340 const VssRayContainer &sampleRays) 1451 1341 { 1452 1342 Exporter *exporter = Exporter::GetExporter("bsp_splits.x3d"); … … 1471 1361 if (0) 1472 1362 { 1473 1363 VssRayContainer outRays; 1474 1364 1475 1365 int raysSize = min((int)sampleRays.size(), mVisualizationSamples); … … 1478 1368 { 1479 1369 // only rays piercing geometry 1480 if (!sampleRays[i]->intersections.empty()) 1481 outRays.push_back(sampleRays[i]); 1370 outRays.push_back(sampleRays[i]); 1482 1371 } 1483 1372 1484 1373 // export rays 1485 exporter->ExportRays(outRays, 1000,RgbColor(1, 1, 0));1374 exporter->ExportRays(outRays, RgbColor(1, 1, 0)); 1486 1375 } 1487 1376 … … 1494 1383 1495 1384 void VspBspViewCellsManager::ExportBspPvs(const ObjectContainer &objects, 1496 const RayContainer &sampleRays)1385 const VssRayContainer &sampleRays) 1497 1386 { 1498 1387 const int leafOut = 10; … … 1514 1403 for (int i = 0; i < (int)vspBspLeaves.size(); ++ i) 1515 1404 { 1516 RayContainer vcRays; 1517 cout << "creating output for view cell " << i << " ... "; 1518 1405 VssRayContainer vcRays; 1406 cout << "creating output for view cell " << i << " ... "; 1407 1408 //$$JB 1409 #if 0 1519 1410 // check whether we can add the current ray to the output rays 1520 1411 for (int k = 0; k < raysOut; ++ k) 1521 1412 { 1522 1413 VssRay *ray = sampleRays[k]; 1523 1414 1524 1415 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) … … 1532 1423 } 1533 1424 } 1534 1425 #endif 1535 1426 1536 1427 Intersectable::NewMail(); … … 1570 1461 1571 1462 // export rays piercing this view cell 1572 exporter->ExportRays(vcRays, 1000,RgbColor(1, 0, 0));1463 exporter->ExportRays(vcRays, RgbColor(1, 0, 0)); 1573 1464 exporter->ExportRays(vspBspLeaves[i]->mVssRays, RgbColor(1, 1, 1)); 1574 1465 … … 1621 1512 { 1622 1513 cout << "creating output for view cell " << i << " ... "; 1623 RayContainer vcRays;1514 VssRayContainer vcRays; 1624 1515 Intersectable::NewMail(); 1625 1516 BspViewCell *vc = dynamic_cast<BspViewCell *>(viewCells[i]); 1626 1517 1627 1518 cout << "creating output for view cell " << i << " ... "; 1519 //$$ JB 1520 #if 0 1628 1521 // check whether we can add the current ray to the output rays 1629 1522 for (int k = 0; k < raysOut; ++ k) 1630 1523 { 1631 1524 Ray *ray = sampleRays[k]; 1632 1525 1633 1526 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) … … 1641 1534 } 1642 1535 } 1643 1536 #endif 1644 1537 //bspLeaves[j]->Mail(); 1645 1538 char s[64]; sprintf(s, "bsp-pvs%04d.x3d", i); … … 1670 1563 1671 1564 // export rays piercing this view cell 1672 exporter->ExportRays(vcRays, 1000,RgbColor(0, 1, 0));1565 exporter->ExportRays(vcRays, RgbColor(0, 1, 0)); 1673 1566 1674 1567 m.mDiffuseColor = RgbColor(1, 0, 0); … … 1771 1664 } 1772 1665 1666 1667 int 1668 VspBspViewCellsManager::CastLineSegment(const Vector3 &origin, 1669 const Vector3 &termination, 1670 ViewCellContainer &viewcells 1671 ) 1672 { 1673 return mVspBspTree->CastLineSegment(origin, termination, viewcells); 1674 }
Note: See TracChangeset
for help on using the changeset viewer.