Changeset 399 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
- Timestamp:
- 11/10/05 01:09:53 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r398 r399 274 274 } 275 275 276 contribution += mViewCell->GetPvs().AddSample(ray->sourceObject.mObject); 276 if (ray->sourceObject.mObject) 277 contribution += mViewCell->GetPvs().AddSample(ray->sourceObject.mObject); 277 278 278 279 if (contribution > 0) … … 281 282 ++ contributingSamples; 282 283 } 283 284 // warning: not ordered 284 // warning: intersections not ordered 285 285 ray->bspIntersections.push_back(Ray::BspIntersection((*it)->mMinT, this)); 286 286 } … … 1392 1392 // assure that we only count a object 1393 1393 // once for the front and once for the back side of the plane 1394 AddToPvs(*ray->intersections[0].mObject, frontData.mPvs, backData.mPvs,1395 1394 IncPvs(*ray->intersections[0].mObject, frontData.mPvs, backData.mPvs, 1395 cf, frontId, backId, frontAndBackId); 1396 1396 } 1397 1397 1398 1398 // the source object in the origin of the ray 1399 AddToPvs(*ray->sourceObject.mObject, frontData.mPvs, backData.mPvs, 1400 cf, frontId, backId, frontAndBackId); 1399 if (ray->sourceObject.mObject) 1400 { 1401 IncPvs(*ray->sourceObject.mObject, frontData.mPvs, backData.mPvs, 1402 cf, frontId, backId, frontAndBackId); 1403 } 1401 1404 1402 1405 // use #rays to approximate volume … … 1429 1432 } 1430 1433 1431 void BspTree:: AddToPvs(Intersectable &obj,1432 1433 1434 1435 1436 1437 1434 void BspTree::IncPvs(Intersectable &obj, 1435 int &frontPvs, 1436 int &backPvs, 1437 const int cf, 1438 const int frontId, 1439 const int backId, 1440 const int frontAndBackId) const 1438 1441 { 1439 1442 if (cf == Ray::COINCIDENT) //TODO: really belongs to no pvs? … … 2311 2314 } 2312 2315 } 2313 if (!ray->sourceObject.mObject->Mailed()) 2314 { 2315 ray->sourceObject.mObject->Mail(); 2316 ++ pvsSize; 2316 if (ray->sourceObject.mObject) 2317 { 2318 if (!ray->sourceObject.mObject->Mailed()) 2319 { 2320 ray->sourceObject.mObject->Mail(); 2321 ++ pvsSize; 2322 } 2317 2323 } 2318 2324 }
Note: See TracChangeset
for help on using the changeset viewer.