Changeset 428


Ignore:
Timestamp:
11/23/05 18:29:41 (19 years ago)
Author:
mattausch
Message:

fixed vspkdtree rays bug

Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r426 r428  
    6262 
    6363Sampling { 
    64         totalSamples    1000000 
     64        totalSamples    600000 
    6565        samplesPerPass  3 
    6666} 
     
    219219 
    220220        Construction { 
    221                 samples 1000000 
     221                samples 500000 
    222222        } 
    223223         
    224224        Termination { 
    225225                maxDepth        30 
    226                 minPvs          50 
    227                 minRays         10 
     226                minPvs          60 
     227                minRays         1 
    228228                minSize         0.1 
    229                 maxCostRatio    0.95 
     229                maxCostRatio    999.0 
    230230                maxRayContribution 0.2 
    231231        } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Exporter.h

    r425 r428  
    110110  GetExporter(const string filename); 
    111111 
    112    
    113112}; 
    114113  
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.cpp

    r426 r428  
    171171} 
    172172 
    173 int 
    174 Ray::ClassifyPlane(const Plane3 &plane,  
    175                                    const float minT,  
    176                                    const float maxT, 
    177                                    Vector3 &entP, 
    178                                    Vector3 &extP) const 
     173int Ray::ClassifyPlane(const Plane3 &plane,  
     174                                           const float minT,  
     175                                           const float maxT, 
     176                                           Vector3 &entP, 
     177                                           Vector3 &extP) const 
    179178{ 
    180179        entP = Extrap(minT); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h

    r426 r428  
    4545                                 const int face):mT(t), mObject(object), mFace(face) {} 
    4646                 
    47     Intersection() {} 
     47                                 Intersection(): mT(0), mObject(NULL), mFace(0) {} 
    4848                 
    4949    bool operator<( 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r426 r428  
    450450                                                        direction = point - pointToSample; 
    451451                                                        point = pointToSample; 
     452                                                        Debug << "point: " << pointToSample << endl; 
    452453                                                } 
    453454                                        } 
     
    667668        if (mVspKdTree) 
    668669        { 
    669                 Exporter *exporter = Exporter::GetExporter("vspkdtree.x3d");  
    670                 //exporter->SetWireframe(); 
    671                 exporter->ExportVspKdTree(*mVspKdTree, mVspKdTree->GetStatistics().maxPvsSize); 
    672  
    673                 Debug << "average PVS size: " << mVspKdTree->GetAvgPvsSize() << endl; 
    674  
    675                 if (1) ExportSceneGeometry(exporter, objects); 
    676  
    677                 bool exportRays = false; 
    678  
    679                 if (exportRays)  
    680                 { 
    681                         int raysSize = 500; 
    682                         float prob = raysSize / (float)mVspSampleRays.size(); 
    683                  
    684                         exporter->SetWireframe(); 
    685                          
    686                         VssRayContainer rays; 
    687                         for (int i = 0; i < mVspSampleRays.size(); ++ i) 
    688                         { 
    689                                 if (RandomValue(0,1) < prob) 
    690                                         rays.push_back(mVspSampleRays[i]); 
    691                         } 
    692  
    693                         exporter->ExportRays(rays, RgbColor(1, 0, 0)); 
    694                 } 
    695  
    696                 delete exporter; 
     670                if (1) 
     671                { 
     672                        Exporter *exporter = Exporter::GetExporter("vspkdtree.x3d");  
     673                        //exporter->SetWireframe(); 
     674                        exporter->ExportVspKdTree(*mVspKdTree, mVspKdTree->GetStatistics().maxPvsSize); 
     675 
     676                        Debug << "average PVS size: " << mVspKdTree->GetAvgPvsSize() << endl; 
     677 
     678                        if (0) ExportSceneGeometry(exporter, objects); 
     679 
     680                        bool exportRays = true; 
     681 
     682                        if (exportRays)  
     683                        { 
     684                                int raysSize = 2000; 
     685                                float prob = raysSize / (float)mVspSampleRays.size(); 
     686                 
     687                                exporter->SetWireframe(); 
     688                         
     689                                VssRayContainer rays; 
     690                                for (int i = 0; i < mVspSampleRays.size(); ++ i) 
     691                                { 
     692                                        if (RandomValue(0,1) < prob) 
     693                                                rays.push_back(mVspSampleRays[i]); 
     694                                } 
     695 
     696                                exporter->ExportRays(rays, RgbColor(1, 0, 0)); 
     697                        } 
     698 
     699                        delete exporter; 
     700                } 
     701 
     702                if (1) 
     703                { 
     704                        vector<VspKdTreeLeaf *> leafContainer; 
     705 
     706                        mVspKdTree->CollectLeaves(leafContainer); 
     707 
     708                        for (int i = 0; i < 10; ++ i) 
     709                        { 
     710                                char s[64]; 
     711                                sprintf(s, "vsp_leaves%04d.x3d", i); 
     712                                Exporter *exporter = Exporter::GetExporter(s); 
     713 
     714                                // export geometry 
     715                                VspKdTreeLeaf *leaf = leafContainer[Random((int)leafContainer.size())];  
     716                                AxisAlignedBox3 box = mVspKdTree->GetBBox(leaf); 
     717 
     718                                Material m; 
     719                                m.mDiffuseColor = RgbColor(0, 1, 1); 
     720                                exporter->SetForcedMaterial(m); 
     721                                exporter->SetWireframe(); 
     722                                exporter->ExportBox(box); 
     723 
     724                                //-- export stored rays 
     725                                VssRayContainer vssRays; 
     726                                leaf->GetRays(vssRays); 
     727 
     728                                VssRayContainer rays; 
     729 
     730                                VssRayContainer::const_iterator it, it_end = vssRays.end(); 
     731 
     732                                for (it = vssRays.begin(); it != it_end; ++ it) 
     733                                        if (!(*it)->mOriginObject) 
     734                                                rays.push_back(*it); 
     735 
     736                                exporter->ExportRays(rays, RgbColor(1, 0, 0)); 
     737 
     738                                //-- export stored PVS 
     739                                ObjectContainer pvsObj; 
     740                                leaf->ExtractPvs(pvsObj); 
     741                                 
     742                                ExportSceneGeometry(exporter, pvsObj); 
     743 
     744                                delete exporter; 
     745                        }                        
     746                } 
    697747        } 
    698748   
     
    757807 
    758808 
    759 void SamplingPreprocessor::ProcessVspViewCells(const Ray &ray, 
     809void SamplingPreprocessor::ProcessVspViewCells(Ray &ray, 
    760810                                               Intersectable *object, 
    761811                                                                                           const int faceIndex, 
     
    768818                if ((int)mVspSampleRays.size() < mVspConstructionSamples) 
    769819                { 
     820                        ray.sourceObject = Ray::Intersection(0.0, object, faceIndex); 
    770821                        VssRay *sRay = new VssRay(ray); 
    771                  
    772             mVspSampleRays.push_back(sRay); 
    773                  
    774                         // also add origin to sample 
    775                         sRay->mOriginObject = object; 
    776                         sRay->mOrigin = ray.GetLoc(); 
     822                        mVspSampleRays.push_back(sRay); 
    777823                } 
    778824                else 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h

    r426 r428  
    7171                                                         int &sampleContributions); 
    7272 
    73         void ProcessVspViewCells(const Ray &ray, 
     73        void ProcessVspViewCells(Ray &ray, 
    7474                                                         Intersectable *object, 
    7575                                                         const int faceIndex, 
     
    100100 
    101101protected: 
     102 
     103 
    102104        int mPass; 
    103105        int mSamplesPerPass; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r426 r428  
    3838int BspTree::sConstructionMethod = FROM_INPUT_VIEW_CELLS; 
    3939 
     40int BspTree::sFrontId = 0;  
     41int BspTree::sBackId = 0; 
     42int BspTree::sFrontAndBackId = 0; 
    4043 
    4144/****************************************************************/ 
     
    14201423} 
    14211424 
     1425inline void BspTree::GenerateUniqueIdsForPvs() 
     1426{ 
     1427        Intersectable::NewMail(); sBackId = ViewCell::sMailId; 
     1428        Intersectable::NewMail(); sFrontId = ViewCell::sMailId; 
     1429        Intersectable::NewMail(); sFrontAndBackId = ViewCell::sMailId; 
     1430} 
     1431 
    14221432float BspTree::SplitPlaneCost(const Plane3 &candidatePlane,  
    14231433                                                          const BoundedRayContainer &rays, 
     
    14451455        if (mSplitPlaneStrategy & PVS) 
    14461456        { 
    1447                 // create three unique ids for pvs heuristics 
    1448                 Intersectable::NewMail(); backId = ViewCell::sMailId; 
    1449                 Intersectable::NewMail(); frontId = ViewCell::sMailId; 
    1450                 Intersectable::NewMail(); frontAndBackId = ViewCell::sMailId; 
     1457                // create unique ids for pvs heuristics 
     1458                GenerateUniqueIdsForPvs(); 
    14511459 
    14521460                if (mPvsUseArea) // use front and back cell areas to approximate volume 
     
    14901498                if (mSplitPlaneStrategy & PVS) 
    14911499                { 
    1492                         if (!ray->intersections.empty()) 
    1493                         { 
    1494                                 // in case the ray intersects an objcrs 
    1495                                 // assure that we only count a object  
    1496                                 // once for the front and once for the back side of the plane 
    1497                                 IncPvs(*ray->intersections[0].mObject, frontPvs, backPvs,  
    1498                                            cf, frontId, backId, frontAndBackId); 
    1499                         } 
    1500  
    1501                         // the source object in the origin of the ray 
    1502                         if (ray->sourceObject.mObject) 
    1503                         { 
    1504                                 IncPvs(*ray->sourceObject.mObject, frontPvs, backPvs,  
    1505                                            cf, frontId, backId, frontAndBackId); 
    1506                         } 
    1507  
     1500                        // in case the ray intersects an object 
     1501                        // assure that we only count the object  
     1502                        // once for the front and once for the back side of the plane 
     1503                         
     1504                        // add the termination object 
     1505                        AddObjToPvs(ray->intersections[0].mObject, cf, frontPvs, backPvs); 
     1506                         
     1507                        // add the source object 
     1508                        AddObjToPvs(ray->sourceObject.mObject, cf, frontPvs, backPvs); 
     1509                         
    15081510                        if (!mPvsUseArea) // use front and back cell areas to approximate volume 
    15091511                        {        
     
    15841586} 
    15851587 
    1586 void BspTree::IncPvs(Intersectable &obj, 
    1587                                          int &frontPvs, 
    1588                                          int &backPvs, 
    1589                                          const int cf,  
    1590                                          const int frontId,  
    1591                                          const int backId,  
    1592                                          const int frontAndBackId) const 
    1593 { 
     1588void BspTree::AddObjToPvs(Intersectable *obj, 
     1589                                                  const int cf, 
     1590                                                  int &frontPvs, 
     1591                                                  int &backPvs) const 
     1592{ 
     1593        if (!obj) 
     1594                return; 
    15941595        // TODO: does this really belong to no pvs? 
    15951596        //if (cf == Ray::COINCIDENT) return; 
    15961597 
    1597         if (cf == Ray::FRONT) 
    1598         { 
    1599                 if ((obj.mMailbox != frontId) &&  
    1600                         (obj.mMailbox != frontAndBackId)) 
     1598        // object belongs to both PVS 
     1599        const bool bothSides = (cf == Ray::FRONT_BACK) ||  
     1600                                                   (cf == Ray::BACK_FRONT) || 
     1601                                                   (cf == Ray::COINCIDENT); 
     1602 
     1603        if ((cf == Ray::FRONT) || bothSides) 
     1604        { 
     1605                if ((obj->mMailbox != sFrontId) &&  
     1606                        (obj->mMailbox != sFrontAndBackId)) 
    16011607                { 
    16021608                        ++ frontPvs; 
    16031609 
    1604                         if (obj.mMailbox != backId) 
    1605                                 obj.mMailbox = frontId; 
     1610                        if (obj->mMailbox == sBackId) 
     1611                                obj->mMailbox = sFrontAndBackId;         
    16061612                        else 
    1607                                 obj.mMailbox = frontAndBackId;                                   
    1608                 } 
    1609         } 
    1610         else if (cf == Ray::BACK) 
    1611         { 
    1612                 if ((obj.mMailbox != backId) && 
    1613                         (obj.mMailbox != frontAndBackId)) 
     1613                                obj->mMailbox = sFrontId;                                                                
     1614                } 
     1615        } 
     1616         
     1617        if ((cf == Ray::BACK) || bothSides) 
     1618        { 
     1619                if ((obj->mMailbox != sBackId) && 
     1620                        (obj->mMailbox != sFrontAndBackId)) 
    16141621                { 
    16151622                        ++ backPvs; 
    16161623 
    1617                         if (obj.mMailbox != frontId) 
    1618                                 obj.mMailbox = backId; 
     1624                        if (obj->mMailbox == sFrontId) 
     1625                                obj->mMailbox = sFrontAndBackId;  
    16191626                        else 
    1620                                 obj.mMailbox = frontAndBackId;  
    1621                 } 
    1622         } 
    1623         // object belongs to both PVS 
    1624         else if ((cf == Ray::FRONT_BACK) || (cf == Ray::BACK_FRONT) ||(cf == Ray::COINCIDENT)) 
    1625         { 
    1626                 if (obj.mMailbox !=  frontAndBackId) 
    1627                 { 
    1628                         if (obj.mMailbox != frontId) 
    1629                                 ++ frontPvs; 
    1630                         if (obj.mMailbox != backId) 
    1631                                 ++ backPvs; 
    1632                  
    1633                         obj.mMailbox = frontAndBackId; 
     1627                                obj->mMailbox = sBackId;                                 
    16341628                } 
    16351629        } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r426 r428  
    328328        void SetViewCell(BspViewCell *viewCell); 
    329329 
    330         /** Adds rays to the PVS. 
    331                 @param sampleContributions the number contributions of the sampels 
     330        /** Adds ray sample contributions to the PVS. 
     331                @param sampleContributions the number contributions of the samples 
    332332                @param contributingSampels the number of contributing rays 
    333333                 
     
    755755        void ExtractHalfSpaces(BspNode *n, vector<Plane3> &halfSpaces) const; 
    756756 
    757         /** Computes the pvs of the front and back leaf with a given classification. 
    758         */ 
    759         void IncPvs(Intersectable &obj,  
    760                                   int &frontPvs, 
    761                                   int &backPvs, 
    762                                   const int cf,  
    763                                   const int frontId,  
    764                                   const int backId,  
    765                                   const int frontAndBackId) const; 
     757        /** Adds the object to the pvs of the front and back leaf with a given classification. 
     758 
     759                @param obj the object to be added 
     760                @param cf the ray classification regarding the split plane 
     761                @param frontPvs returns the PVS of the front partition 
     762                @param backPvs returns the PVS of the back partition 
     763         
     764        */ 
     765        void AddObjToPvs(Intersectable *obj, const int cf, int &frontPvs, int &backPvs) const; 
    766766         
    767767        int ComputePvsSize(const BoundedRayContainer &rays) const; 
     
    859859 
    860860private: 
     861         
    861862        /** Evaluates split plane classification with respect to the plane's  
    862863                contribution for a balanced tree. 
     
    876877        static const float sBalancedRaysTable[5]; 
    877878 
     879        /// Generates unique ids for PVS criterium 
     880        static void GenerateUniqueIdsForPvs(); 
     881 
     882        //-- unique ids for PVS criterium 
     883        static int sFrontId;  
     884        static int sBackId; 
     885        static int sFrontAndBackId; 
    878886}; 
    879887 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp

    r426 r428  
    2626#include "RayInfo.h" 
    2727 
     28 
    2829// Static variables 
    2930int VspKdTreeLeaf::mailID = 0; 
     31 
     32#define USE_FIXEDPOINT_T 0 
    3033 
    3134/// Adds object to the pvs of the front and back node 
     
    5154        } 
    5255         
    53         if (side >= 0)  
     56        if (side >= 0) 
    5457        { 
    5558                if (!object->Mailed(1) && !object->Mailed(2))  
    5659                { 
    5760                        ++ pvsFront; 
     61 
    5862                        if (object->Mailed()) 
    5963                                object->Mail(2); 
     
    245249        return mRays; 
    246250} 
     251 
     252void VspKdTreeLeaf::ExtractPvs(ObjectContainer &objects) const 
     253{ 
     254        RayInfoContainer::const_iterator it, it_end = mRays.end(); 
     255 
     256        for (it = mRays.begin(); it != it_end; ++ it) 
     257        { 
     258                if ((*it).mRay->mTerminationObject) 
     259                        objects.push_back((*it).mRay->mTerminationObject); 
     260                if ((*it).mRay->mOriginObject) 
     261                        objects.push_back((*it).mRay->mOriginObject); 
     262        } 
     263} 
     264 
     265void VspKdTreeLeaf::GetRays(VssRayContainer &rays) 
     266{ 
     267        RayInfoContainer::const_iterator it, it_end = mRays.end(); 
     268 
     269        for (it = mRays.begin(); it != mRays.end(); ++ it) 
     270                rays.push_back((*it).mRay); 
     271} 
     272 
    247273/*********************************************************/ 
    248274/*            class VspKdTree implementation             */ 
     
    250276 
    251277 
    252 // Constructor 
    253 VspKdTree::VspKdTree(): 
    254 mOnlyDrivingAxis(true) 
     278VspKdTree::VspKdTree(): mOnlyDrivingAxis(true) 
    255279{          
    256280        environment->GetIntValue("VspKdTree.Termination.maxDepth", mTermMaxDepth); 
     
    546570{ 
    547571        int minDirDepth = 6; 
    548         int axis; 
    549         float costRatio; 
     572        int axis = 0; 
     573        float costRatio = 0; 
    550574         
    551575        if (splitType == ESplitRegular)  
     
    575599        } 
    576600 
    577         if (0 && costRatio > mTermMaxCostRatio)  
     601        if (costRatio > mTermMaxCostRatio)  
    578602        { 
    579603                Debug << "Too big cost ratio " << costRatio << endl; 
     
    581605        } 
    582606 
    583 #if 1    
    584         Debug << 
    585                 "pvs=" << leaf->mPvsSize << 
    586                 " rays=" << (int)leaf->mRays.size() << 
    587                 " rc=" << leaf->GetAvgRayContribution() << 
    588                 " axis=" << axis << endl; 
    589 #endif 
     607        if (0) 
     608                Debug << "pvs=" << leaf->mPvsSize  
     609                          << " rays=" << (int)leaf->mRays.size()  
     610                          << " rc=" << leaf->GetAvgRayContribution()  
     611                          << " axis=" << axis << endl; 
    590612         
    591613        return axis; 
     
    638660        float ratio = 0; 
    639661         
    640         if (1) 
    641         { 
    642                 const float sum = pvsBack + pvsFront; 
     662        if (0) 
     663        { 
     664                const float sum = float(pvsBack + pvsFront); 
    643665                const float oldCost = (float)pvsSize * 2; 
    644666 
    645667                return sum / oldCost; 
    646668        } 
    647         else { 
     669        else  
     670        { 
    648671                AxisAlignedBox3 box = GetBBox(leaf); 
    649672         
     
    653676                 
    654677                // float sum = raysBack*(position - minBox) + raysFront*(maxBox - position); 
    655                 float sum = pvsBack * (position - minBox) + pvsFront * (maxBox - position); 
     678                const float sum = pvsBack * (position - minBox) + pvsFront * (maxBox - position); 
    656679 
    657680                newCost = mCtDivCi + sum  / sizeBox; 
     
    659682                //Debug << axis << " " << pvsSize << " " << pvsBack << " " << pvsFront << endl; 
    660683                //  float oldCost = leaf->mRays.size(); 
    661                 float oldCost = (float)pvsSize; 
     684                const float oldCost = (float)pvsSize; 
    662685                 
    663686                float ratio = newCost / oldCost; 
    664          
    665687        } 
    666688         
     
    685707        AxisAlignedBox3 sBox = GetBBox(leaf); 
    686708 
    687         // int sAxis = box.Size().DrivingAxis(); 
    688         int sAxis = sBox.Size().DrivingAxis(); 
     709        const int sAxis = sBox.Size().DrivingAxis(); 
    689710 
    690711        for (axis = 0; axis < 3; ++ axis)  
     
    706727                        else 
    707728                                if (nCostRatio[axis] < nCostRatio[bestAxis]) 
     729                                { 
     730                                        Debug << "pvs front " << nPvsBack[axis] 
     731                                                  << " pvs back " << nPvsFront[axis] 
     732                                                  << " overall pvs " << leaf->GetPvsSize() << endl; 
    708733                                        bestAxis = axis; 
    709                 } 
    710         } 
    711  
     734                                } 
     735                } 
     736        } 
     737 
     738        //-- assign best axis 
    712739        axis = bestAxis; 
    713740        position = nPosition[bestAxis]; 
     
    924951        if (TerminationCriteriaMet(leaf, box)) 
    925952        { 
    926                 if (1) 
    927                 { 
    928                         if (leaf->mDepth >= mTermMaxDepth)  
    929                         { 
    930                                 Debug << "Warning: max depth reached depth=" << (int)leaf->mDepth<<" rays=" << (int)leaf->mRays.size() << endl; 
    931                                 Debug << "Bbox: " << GetBBox(leaf) << endl; 
    932                         } 
    933                         //Debug << "depth: " << (int)leaf->mDepth << " pvs: " << leaf->GetPvsSize() << " rays: " << leaf->mRays.size() << endl; 
    934                 } 
     953                if (1 && leaf->mDepth >= mTermMaxDepth)  
     954                { 
     955                        Debug << "Warning: max depth reached depth=" << (int)leaf->mDepth<<" rays=" << (int)leaf->mRays.size() << endl; 
     956                        Debug << "Bbox: " << GetBBox(leaf) << endl; 
     957                } 
     958                //Debug << "depth: " << (int)leaf->mDepth << " pvs: " << leaf->GetPvsSize() << " rays: " << leaf->mRays.size() << endl; 
     959                 
    935960                return leaf; 
    936961        } 
     
    13511376#if DEBUG_COLLAPSE 
    13521377        cout << "Collapsing subtree" << endl; 
    1353         cout << "acessTime=" << sroot->GetAccessTime() << endl; 
     1378        cout << "accessTime=" << sroot->GetAccessTime() << endl; 
    13541379        cout << "depth=" << (int)sroot->depth << endl; 
    13551380#endif 
     
    17171742        return pvsSize; 
    17181743} 
     1744 
     1745void VspKdTree::CollectLeaves(vector<VspKdTreeLeaf *> &leaves) const 
     1746{ 
     1747        stack<VspKdTreeNode *> nodeStack; 
     1748        nodeStack.push(mRoot); 
     1749 
     1750        while (!nodeStack.empty())  
     1751        { 
     1752                VspKdTreeNode *node = nodeStack.top(); 
     1753                 
     1754                nodeStack.pop(); 
     1755                 
     1756                if (node->IsLeaf())  
     1757                { 
     1758                        VspKdTreeLeaf *leaf = dynamic_cast<VspKdTreeLeaf *>(node); 
     1759                        leaves.push_back(leaf); 
     1760                }  
     1761                else  
     1762                { 
     1763                        VspKdTreeInterior *interior = dynamic_cast<VspKdTreeInterior *>(node); 
     1764 
     1765                        nodeStack.push(interior->mBack); 
     1766                        nodeStack.push(interior->mFront); 
     1767                } 
     1768        } 
     1769} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h

    r426 r428  
    3232 
    3333#include "RayInfo.h" 
    34  
     34#include "Containers.h" 
    3535 
    3636/** 
     
    123123 
    124124        friend class VspKdTree; 
    125 #define USE_FIXEDPOINT_T 1 
    126125 
    127126        enum {EInterior, ELeaf}; 
     
    266265        void UpdatePvsSize(); 
    267266 
     267        /** Returns stored rays. 
     268        */ 
    268269        RayInfoContainer &GetRays(); 
    269270 
     271        /** Returns rays into this ray container. 
     272        */ 
     273        void GetRays(VssRayContainer &rays); 
    270274        /** Returns average contribution of a ray to the PVS 
    271275        */ 
     
    275279        inline float GetSqrRayContribution() const; 
    276280 
     281        /** Extracts PVS from ray set. 
     282        */ 
     283        void ExtractPvs(ObjectContainer &objects) const; 
     284 
    277285        //-- mailing options 
    278  
    279286        void Mail(); 
    280287 
     
    286293 
    287294        static int mailID; 
     295 
    288296 
    289297protected: 
     
    441449        float GetRayMemUsage() const; 
    442450 
     451        /** Collects leaves of this tree. 
     452        */ 
     453        void CollectLeaves(vector<VspKdTreeLeaf *> &leaves) const; 
     454 
    443455protected: 
     456 
    444457        // incremental construction 
    445458        virtual void UpdateRays(VssRayContainer &remove, VssRayContainer &add); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssRay.h

    r427 r428  
    7272                        mOrigin = ray.GetLoc();  
    7373 
     74                Debug << "origin: " << mOrigin << endl; 
     75 
    7476                if (!ray.intersections.empty()) 
    7577                { 
     
    7981                else 
    8082                { 
    81                         mTermination = 1e6; 
     83                        //mTermination = 1e6; 
     84                        mTermination = mOrigin + ray.GetDir() * 1e6; 
    8285                        mTerminationObject = NULL; 
    8386                } 
Note: See TracChangeset for help on using the changeset viewer.