Changeset 558 for trunk/VUT/GtpVisibilityPreprocessor/src
- Timestamp:
- 01/20/06 03:42:21 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r557 r558 2221 2221 lm = vm; 2222 2222 2223 vm.mDiffuseColor.r -= 0. 3f;2224 vm.mDiffuseColor.g -= 0. 3f;2225 vm.mDiffuseColor.b -= 0. 3f;2223 vm.mDiffuseColor.r -= 0.45f; 2224 vm.mDiffuseColor.g -= 0.45f; 2225 vm.mDiffuseColor.b -= 0.45f; 2226 2226 2227 2227 vector<BspLeaf *>::const_iterator lit, lit_end = vc->mLeaves.end(); -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r557 r558 2557 2557 else // throw them into old view cells container 2558 2558 { 2559 fVc->mMailbox = -1; 2560 bVc->mMailbox = -1; 2559 //fVc->mMailbox = -1; 2560 //bVc->mMailbox = -1; 2561 fVc->SetId(-2); 2562 bVc->SetId(-2); 2561 2563 2562 2564 mOldViewCells.push_back(fVc); 2563 2565 mOldViewCells.push_back(bVc); 2564 2566 2565 2567 mNewViewCells.push_back(vc); 2566 2568 } … … 2816 2818 int pass = 0; 2817 2819 const int nextPass = 200; 2818 2820 for (int k = 0; k < (int)viewCells.size(); ++ k) 2821 Debug << "vc mailid4: " << viewCells[k]->mMailbox << endl; 2819 2822 cout << "starting merge ... "; 2820 2823 … … 2873 2876 2874 2877 ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 2875 2876 Debug << "here2111 " << viewCells.size() << endl; 2877 for (int i = 0; i < viewCells.size(); ++ i) 2878 2879 // find all already merged view cells and remove them from view cells 2880 int i = 0; 2881 while (1) 2878 2882 { 2879 while (!viewCells.empty() && (viewCells.back()->mMailbox == -1)) 2883 //while (!viewCells.empty() && (viewCells.back()->mMailbox == -1)) 2884 while (!viewCells.empty() && (viewCells.back()->GetId() == -2)) 2880 2885 { 2881 D ebug << "here244" << endl;2886 DEL_PTR(viewCells.back()); 2882 2887 viewCells.pop_back(); 2883 2888 } 2889 // all merged view cells have been found 2890 if (i >= viewCells.size()) 2891 break; 2884 2892 2885 2893 // already merged view cell, put it to end of vector 2886 if ((i < viewCells.size()) && (viewCells[i]->mMailbox == -1)) 2887 { 2888 Debug << "here2" << endl; 2894 //if (viewCells[i]->mMailbox == -1) 2895 if (viewCells[i]->GetId() == -2) 2889 2896 swap(viewCells[i], viewCells.back()); 2890 } 2897 2898 ++ i; 2891 2899 } 2892 2900 2901 for (int k = 0; k < (int)viewCells.size(); ++ k) 2902 //Debug << "vc mailid: " << viewCells[k]->mMailbox << endl; 2903 Debug << "vc id: " << viewCells[k]->GetId() << endl; 2904 2893 2905 cout << "finished" << endl; 2894 2906 // not part of any leaf 2895 CLEAR_CONTAINER(mOldViewCells); 2907 //CLEAR_CONTAINER(mOldViewCells); 2908 mOldViewCells.clear(); 2896 2909 2897 2910 int newVcSize = (int)mNewViewCells.size(); … … 2913 2926 ViewCellContainer::const_iterator it, it_end = viewCells.end(); 2914 2927 2928 // new view cells are on the back 2915 2929 int i = (int)viewCells.size(); 2916 2930 for (it = viewCells.begin(); it != it_end; ++ it) 2917 2931 { 2918 Material m = RandomMaterial(); 2919 if (i-- == newVcSize) 2932 Material m; 2933 2934 if (i -- < newVcSize) 2920 2935 { 2921 m.mDiffuseColor.r = 1;2936 m.mDiffuseColor.r = RandomValue(0.5, 1.0); 2922 2937 m.mDiffuseColor.g = 0; 2923 2938 m.mDiffuseColor.b = 0; 2924 2939 } 2940 else 2941 { 2942 float col = RandomValue(0.5, 1.0); 2943 m.mDiffuseColor.r = col; 2944 m.mDiffuseColor.g = col; 2945 m.mDiffuseColor.b = col; 2946 } 2947 2925 2948 exporter->SetForcedMaterial(m); 2926 2949 mViewCellsManager->ExportVcGeometry(exporter, *it);
Note: See TracChangeset
for help on using the changeset viewer.