- Timestamp:
- 10/18/05 11:17:29 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj
r309 r338 65 65 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;" 66 66 RuntimeLibrary="2" 67 DisableLanguageExtensions="FALSE" 68 ForceConformanceInForLoopScope="FALSE" 67 69 RuntimeTypeInfo="TRUE" 68 70 UsePrecompiledHeader="0" -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
r333 r338 30 30 int limit = maxViewCells > 0 ? Min((int)objects.size(), maxViewCells) : (int)objects.size(); 31 31 32 for (int i = 0; i < limit; ++ i)32 for (int i = 0; i < limit; ++ i) 33 33 { 34 34 Intersectable *object = objects[i]; -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r337 r338 1099 1099 int totalViewCells = 0; 1100 1100 1101 // needed for balanced view cells criterium 1101 1102 ViewCell::NewMail(); 1102 1103 int backId = ViewCell::mailID; 1104 ViewCell::NewMail(); 1105 int frontId = ViewCell::mailID; 1106 ViewCell::NewMail(); 1107 int frontAndBackId = ViewCell::mailID; 1108 1103 1109 PolygonContainer::const_iterator it, it_end = polys.end(); 1104 1110 … … 1135 1141 MeshInstance *viewCell = (*it)->mParent; 1136 1142 1137 if (!viewCell->Mailed()) 1143 // assure that we only count a view cell 1144 // once for the front and once for the back side of the plane 1145 if (classification == Plane3::FRONT_SIDE) 1138 1146 { 1139 viewCell->Mail(); 1140 sumBalancedViewCells += sBalancedTreeTable[classification]; 1141 1142 ++ totalViewCells; 1147 if ((viewCell->mailbox != frontId) && 1148 (viewCell->mailbox != frontAndBackId)) 1149 { 1150 sumBalancedViewCells += 1.0; 1151 1152 if (viewCell->mailbox != backId) 1153 viewCell->mailbox = frontId; 1154 else 1155 viewCell->mailbox = frontAndBackId; 1156 1157 ++ totalViewCells; 1158 } 1159 } 1160 else if (classification == Plane3::BACK_SIDE) 1161 { 1162 if ((viewCell->mailbox != backId) && 1163 (viewCell->mailbox != frontAndBackId)) 1164 { 1165 sumBalancedViewCells -= 1.0; 1166 1167 if (viewCell->mailbox != frontId) 1168 viewCell->mailbox = backId; 1169 else 1170 viewCell->mailbox = frontAndBackId; 1171 1172 ++ totalViewCells; 1173 } 1143 1174 } 1144 1175 } … … 1549 1580 } 1550 1581 1582 int BspTree::MergeViewCells() 1583 { 1584 stack<BspNode *> nodeStack; 1585 nodeStack.push(mRoot); 1586 1587 ViewCell::NewMail(); 1588 1589 while (!nodeStack.empty()) 1590 { 1591 BspNode *node = nodeStack.top(); 1592 nodeStack.pop(); 1593 1594 if (node->IsLeaf()) 1595 { 1596 } 1597 else 1598 { 1599 BspInterior *interior = dynamic_cast<BspInterior *>(node); 1600 1601 nodeStack.push(interior->mFront); 1602 nodeStack.push(interior->mBack); 1603 } 1604 } 1605 return 0; 1606 } 1607 1551 1608 void BspTree::SetGenerateViewCells(int generateViewCells) 1552 1609 { -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r336 r338 348 348 int CastRay(Ray &ray); 349 349 350 /** Set true if view cells shall be generated in each leaf. 350 /** Merges view cells based on some criteria (e.g., empty view cells or 351 view cells which have a very similar PVS can be merged to one larger 352 view cell farther up in the BSP tree. 353 @returns the number of merged view cells 354 */ 355 int MergeViewCells(); 356 357 /** Set to true if new view cells shall be generated in each leaf. 351 358 */ 352 359 void SetGenerateViewCells(int generateViewCells);
Note: See TracChangeset
for help on using the changeset viewer.