Changeset 570 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
- Timestamp:
- 01/23/06 18:34:47 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r568 r570 1980 1980 bool isAdjacent = true; 1981 1981 1982 /*if (1)1982 if (1) 1983 1983 { 1984 1984 // test all planes of current node if still adjacent … … 2014 2014 } 2015 2015 } 2016 } */2016 } 2017 2017 // neighbor was found 2018 2018 if (isAdjacent) … … 3115 3115 queue<BspMergeCandidate> *backQueue = &queue2; 3116 3116 3117 #if 13118 Exporter *exporter = Exporter::GetExporter("neighors.x3d");3119 3120 if (exporter)3121 {3122 cout << "exporting neighbors ... ";3123 exporter->ExportGeometry(objects);3124 }3125 3126 // HACK for visualization3127 //ViewCellContainer viewCells;3128 //ViewCell::NewMail();3129 //CollectViewCells(mRoot, true, viewCells, true);3130 //for (int i = 0; i < viewCells.size(); ++i)3131 // viewCells[i]->SetId((int)RandomValue(0, Real(256*256*256)));3132 3133 3134 3117 while (!mMergeQueue.empty()) 3135 3118 { … … 3137 3120 shuffleQueue->push(mc); 3138 3121 mMergeQueue.pop(); 3139 3140 // visualize neighbors 3141 Material m = RandomMaterial(); 3142 exporter->SetForcedMaterial(m); 3143 3144 3145 if (!mc.GetLeaf1()->Mailed()) 3146 { 3147 BspNodeGeometry geom1; 3148 ConstructGeometry(mc.GetLeaf1(), geom1); 3149 //m.mDiffuseColor.r = (mc.GetLeaf1()->GetViewCell()->GetId() & 256)/ 255.0f; 3150 //m.mDiffuseColor.g = ((mc.GetLeaf1()->GetViewCell()->GetId()>>8) & 256)/ 255.0f; 3151 //m.mDiffuseColor.b = ((mc.GetLeaf1()->GetViewCell()->GetId()>>16) & 256)/ 255.0f; 3152 //exporter->SetForcedMaterial(m); 3153 exporter->ExportPolygons(geom1.mPolys); 3154 mc.GetLeaf1()->Mail(); 3155 } 3156 3157 if (!mc.GetLeaf2()->Mailed()) 3158 { 3159 BspNodeGeometry geom2; 3160 ConstructGeometry(mc.GetLeaf2(), geom2); 3161 //m.mDiffuseColor.r = (mc.GetLeaf2()->GetViewCell()->GetId() & 256)/ 255.0f; 3162 //m.mDiffuseColor.g = ((mc.GetLeaf2()->GetViewCell()->GetId()>>8) & 256)/ 255.0f; 3163 //m.mDiffuseColor.b = ((mc.GetLeaf2()->GetViewCell()->GetId()>>16) & 256)/ 255.0f; 3164 //exporter->SetForcedMaterial(m); 3165 exporter->ExportPolygons(geom2.mPolys); 3166 mc.GetLeaf2()->Mail(); 3167 } 3168 } 3169 3170 if (exporter) 3171 { 3172 cout << "finished" << endl; 3173 delete exporter; 3174 } 3175 #else 3176 while (!mMergeQueue.empty()) 3177 { 3178 BspMergeCandidate mc = mMergeQueue.top(); 3179 shuffleQueue->push(mc); 3180 mMergeQueue.pop(); 3181 } 3182 #endif 3122 } 3123 3183 3124 const int numPasses = 5; 3184 3125 int pass = 0; … … 3257 3198 //const int pvs1 = SubtractedPvsSize(vc1, leaf, *leaf->mPvs); 3258 3199 const int pvs1 = SubtractedPvsSize(vc1->GetPvs(), *leaf->mPvs); 3259 3260 3200 const int pvs2 = AddedPvsSize(vc2->GetPvs(), *leaf->mPvs); 3261 3201 … … 3277 3217 } 3278 3218 3279 const float cost1 = (float)pvs1 * p1;3280 const float cost2 = (float)pvs2 * p2;3219 const float cost1 = (float)pvs1;// * p1; 3220 const float cost2 = (float)pvs2;// * p2; 3281 3221 3282 3222 return cost1 + cost2; … … 3330 3270 BspViewCell *vc2 = leaf2->GetViewCell(); 3331 3271 3332 float cost1 ;3333 float cost2 ;3334 3335 if (mUseAreaForPvs)3272 float cost1 = vc1->GetPvs().GetSize(); 3273 float cost2 = vc2->GetPvs().GetSize(); 3274 3275 /*if (mUseAreaForPvs) 3336 3276 { 3337 3277 cost1 = vc1->GetPvs().GetSize() * vc1->GetArea(); … … 3342 3282 cost1 = vc1->GetPvs().GetSize() * vc1->GetVolume(); 3343 3283 cost2 = vc2->GetPvs().GetSize() * vc2->GetVolume(); 3344 } 3284 }*/ 3345 3285 3346 3286 const float oldCost = cost1 + cost2; … … 3450 3390 } 3451 3391 3392 3452 3393 /************************************************************************/ 3453 3394 /* BspMergeCandidate implementation */
Note: See TracChangeset
for help on using the changeset viewer.