- Timestamp:
- 01/05/07 16:06:23 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1934 r1941 1553 1553 } 1554 1554 1555 // only use a subset of the rays for visibility based heuristics 1556 if (mUseCostHeuristics && useVisibilityBasedHeuristics) 1555 // if #rays high consider only use a subset of the rays for 1556 // visibility based heuristics 1557 VssRay::NewMail(); 1558 1559 if ((mMaxTests < tData.mNumRays) && mUseCostHeuristics && useVisibilityBasedHeuristics) 1557 1560 { 1558 1561 VssRayContainer rays; 1562 1559 1563 // maximal 2 objects share the same ray 1560 1564 rays.reserve(tData.mNumRays * 2); 1561 1565 CollectRays(tData.mNode->mObjects, rays); 1562 1566 1563 const float prop = (float)mMaxTests / (float)tData.mNumRays; 1564 1565 VssRay::NewMail(); 1567 const float prop = (float)mMaxTests / (float)rays.size(); 1566 1568 1567 1569 VssRayContainer::const_iterator rit, rit_end = rays.end(); 1568 1570 1569 int nRays = 0; 1570 1571 // mail rays which will not be considered 1571 1572 for (rit = rays.begin(); rit != rit_end; ++ rit) 1572 1573 { 1573 if ( (mMaxTests >= (int)rays.size()) || (Random(1.0f) < prop))1574 if (Random(1.0f) > prop) 1574 1575 { 1575 1576 (*rit)->Mail(); 1576 ++ nRays;1577 1577 } 1578 } 1578 } 1579 1579 } 1580 1580 … … 1839 1839 ViewCellContainer &viewCells, 1840 1840 const bool setCounter, 1841 const bool only MailedRays) const1841 const bool onlyUnmailedRays) const 1842 1842 { 1843 1843 ViewCell::NewMail(); … … 1849 1849 { 1850 1850 // always use only mailed objects 1851 numRays += CollectViewCells(*oit, viewCells, true, setCounter, only MailedRays);1851 numRays += CollectViewCells(*oit, viewCells, true, setCounter, onlyUnmailedRays); 1852 1852 } 1853 1853 … … 1860 1860 const bool useMailBoxing, 1861 1861 const bool setCounter, 1862 const bool only MailedRays) const1862 const bool onlyUnmailedRays) const 1863 1863 { 1864 1864 VssRayContainer::const_iterator rit, rit_end = obj->GetOrCreateRays()->end(); … … 1870 1870 VssRay *ray = (*rit); 1871 1871 1872 if (only MailedRays && !ray->Mailed())1872 if (onlyUnmailedRays && ray->Mailed()) 1873 1873 { 1874 1874 continue; -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1933 r1941 822 822 ViewCellContainer &viewCells, 823 823 const bool setCounter, 824 const bool only MailedRays) const;824 const bool onlyUnmailedRays) const; 825 825 826 826 /** Collects view cells which see an object. … … 828 828 only unmailed object should pass 829 829 @param setCounter counter for the sweep algorithm 830 @param only MailedRays if onlymailed rays should be considered830 @param onlyUnmailedRays if only unmailed rays should be considered 831 831 */ 832 832 int CollectViewCells(Intersectable *object, … … 834 834 const bool useMailBoxing, 835 835 const bool setCounter, 836 const bool only MailedRays) const;836 const bool onlyUnmailedRays) const; 837 837 838 838 /** Counts the view cells of this object. note: only -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r1935 r1941 125 125 if (mUseFalseColors) 126 126 SetupFalseColor(object->mId); 127 127 glColor3f(1, 1,1); 128 128 129 129 switch (object->Type()) {
Note: See TracChangeset
for help on using the changeset viewer.