Changeset 1137


Ignore:
Timestamp:
07/17/06 18:17:09 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj

    r1135 r1137  
    206206                        </File> 
    207207                        <File 
    208                                 RelativePath="..\src\KdIntersectable.cpp"> 
    209                         </File> 
    210                         <File 
    211                                 RelativePath="..\src\KdIntersectable.h"> 
    212                         </File> 
    213                         <File 
    214208                                RelativePath="..\src\KdTree.cpp"> 
    215209                        </File> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1106 r1137  
    12641264        mLocalSplitCandidates->reserve(requestedSize); 
    12651265 
    1266         float pos; 
    1267  
    1268         // float values => don't compare with exact values 
    12691266        if (0) 
    1270         { 
     1267        {       // float values => don't compare with exact values 
    12711268                minBand += Limits::Small; 
    12721269                maxBand -= Limits::Small; 
     
    12771274        { 
    12781275                const bool positive = (*ri).mRay->HasPosDir(axis); 
    1279                                  
    1280                 pos = (*ri).ExtrapOrigin(axis); 
     1276                float pos = (*ri).ExtrapOrigin(axis); 
     1277 
    12811278                // clamp to min / max band 
    12821279                if (0) ClipValue(pos, minBand, maxBand); 
     
    12861283 
    12871284                pos = (*ri).ExtrapTermination(axis); 
     1285 
    12881286                // clamp to min / max band 
    12891287                if (0) ClipValue(pos, minBand, maxBand); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1135 r1137  
    934934        float pos; 
    935935 
     936        RayInfoContainer::const_iterator rit, rit_end = rays.end(); 
     937 
    936938        //-- insert all queries 
    937         for (RayInfoContainer::const_iterator ri = rays.begin(); ri < rays.end(); ++ ri) 
    938         { 
    939                 const bool positive = (*ri).mRay->HasPosDir(axis); 
     939        for (rit = rays.begin(); rit != rit_end; ++ rit) 
     940        { 
     941                const bool positive = (*rit).mRay->HasPosDir(axis); 
    940942                                 
    941                 pos = (*ri).ExtrapOrigin(axis); 
     943                pos = (*rit).ExtrapOrigin(axis); 
    942944                 
    943945                mSplitCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax,  
    944                                                                         pos, (*ri).mRay)); 
    945  
    946                 pos = (*ri).ExtrapTermination(axis); 
     946                                                                        pos, (*rit).mRay)); 
     947 
     948                pos = (*rit).ExtrapTermination(axis); 
    947949 
    948950                mSplitCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMax : SortableEntry::ERayMin,  
    949                                                                         pos, (*ri).mRay)); 
     951                                                                        pos, (*rit).mRay)); 
    950952        } 
    951953 
     
    10051007 
    10061008                //-- the objects belonging to several leaves must be handled seperately 
     1009 
    10071010                ObjectContainer::const_iterator oit, oit_end = node->mMultipleObjects.end(); 
    10081011 
     
    26252628 
    26262629 
    2627 /*****************************************************************/ 
    2628 /*                class OspTree implementation                   */ 
    2629 /*****************************************************************/ 
     2630void VspTree::GetViewCells(const VssRay &ray, ViewCellContainer &viewCells) 
     2631{ 
     2632        // if no precomputation of view cells 
     2633        CastLineSegment(ray.mOrigin, ray.mTermination, viewCells); 
     2634} 
     2635 
     2636 
     2637/*******************************************************************/ 
     2638/*                  class OspTree implementation                   */ 
     2639/*******************************************************************/ 
    26302640 
    26312641 
     
    30093019   
    30103020        const int totalPvs = tData.mNode->mObjects.size(); 
    3011  
    3012                                  
     3021         
     3022        int pvsl = 0; 
     3023        int pvsr = totalPvs; 
     3024 
    30133025        // if no good split can be found, take mid split 
    3014         int pvsBack = totalPvs / 2; 
     3026        position = minBox + 0.5f * sizeBox; 
    30153027         
    30163028        // the relative cost ratio 
     
    30233035        float volFront = volr; 
    30243036 
     3037        int pvsBack = 0; 
     3038        int pvsFront = 0; 
     3039         
     3040 
    30253041        float sum = (float)totalVol * sizeBox; 
    30263042 
    3027         int currentPvs = 0; 
    3028  
    30293043        Intersectable::NewMail(); 
    3030  
    3031         //-- traverse through visibility events 
     3044        ViewCell::NewMail(); 
     3045 
     3046        //-- traverse through events and find best split plane 
    30323047 
    30333048        vector<SortableEntry>::const_iterator ci, ci_end = mSplitCandidates->end(); 
    30343049 
    3035         for (ci = mSplitCandidates->begin(); ci != ci_end; ++ ci, ++ currentPvs) 
     3050        for (ci = mSplitCandidates->begin(); ci != ci_end; ++ ci) 
    30363051        { 
    30373052                Intersectable *object = (*ci).mObject; 
    30383053 
    3039                 // new object in this node -> add to the pvs 
    3040                 if (!object->Mailed()) 
    3041                 { 
    3042                         object->Mail(); 
    3043                         ++ currentPvs; 
    3044                 } 
    3045  
    3046                 EvalViewCellVolumeIncr(*ci, voll, volr); 
     3054                EvalHeuristicsContribution(*ci, voll, volr, pvsl, pvsr); 
    30473055 
    30483056                cout << "incr: " << ci->mObject->mViewCellPvs.GetSize() << " obj id "  
     
    30533061                { 
    30543062                        //sum = costl * ((*ci).value - minBox) + costr * (maxBox - (*ci).value); 
    3055                         sum = voll * currentPvs + volr * (totalPvs - currentPvs); 
    3056  
    3057                         cout << "pos=" << currentPvs << "\t volt=(" <<  voll << ","  
    3058                                  << volr << ")" << "\t volt= " << sum << endl; 
     3063                        sum = voll * pvsBack + volr * pvsFront; 
     3064 
     3065                        cout << "pos: " << (*ci).mPos  
     3066                                 << "\t (pvsl: " << pvsBack << ", pvsr: " << pvsFront << ")" 
     3067                                 << "\t (voll: " << voll << ", volr: " << volr << ")" 
     3068                                 << "\t sum: " << sum << endl; 
    30593069 
    30603070                        if (sum < minSum) 
     
    30633073 
    30643074                                minSum = sum; 
    3065                                 pvsBack = currentPvs; 
     3075 
     3076                                pvsBack = pvsl; 
     3077                                pvsFront = pvsr; 
    30663078                                 
    30673079                                volBack = voll; 
    30683080                                volFront = volr; 
    3069                         } 
    3070                 } 
    3071         } 
    3072          
     3081 
     3082                                position = (*ci).mPos; 
     3083                        } 
     3084                } 
     3085        } 
     3086         
     3087 
    30733088        //-- compute cost 
    30743089 
     
    30813096 
    30823097        const float penaltyOld = (float)totalPvs;//EvalPvsPenalty(pvsSize, lowerPvsLimit, upperPvsLimit); 
    3083     const float penaltyFront = (float)totalPvs - pvsBack;//EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit); 
     3098    const float penaltyFront = (float)pvsFront;//EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit); 
    30843099        const float penaltyBack = (float)pvsBack;//EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit); 
    30853100         
     
    31133128        KdLeaf *leaf = tData.mNode; 
    31143129 
    3115         int requestedSize = 2 * (int)rays->size(); 
     3130        int requestedSize = 2 * (int)rays->size() + 2 * (int)leaf->mObjects.size(); 
    31163131 
    31173132        // creates a sorted split candidates array 
     
    31273142        float pos; 
    31283143 
    3129         //-- insert all queries 
    3130         for (RayInfoContainer::const_iterator ri = rays->begin(); ri < rays->end(); ++ ri) 
    3131         { 
    3132                 const bool positive = (*ri).mRay->HasPosDir(axis); 
    3133                                  
    3134                 pos = (*ri).ExtrapOrigin(axis); 
    3135          
    3136  
    3137                 //if (mOspTree->GetLeaf() == leaf) 
    3138  
    3139         /*      mSplitCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax,  
    3140                                                                         pos, (*ri).mRay)); 
    3141  
    3142                 pos = (*ri).ExtrapTermination(axis); 
    3143  
    3144                 mSplitCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMax : SortableEntry::ERayMin,  
    3145                                                                         pos, (*ri).mRay));*/ 
     3144        //-- insert ray queries 
     3145        //-- we are intersested only in rays which intersect an object that 
     3146        //-- is part of the kd node because they can induce a change in view cell 
     3147        //-- volume on the left and the right part.  
     3148        //-- Note that they cannot induce a change in pvs size!! 
     3149 
     3150        RayInfoContainer::const_iterator rit, rit_end = rays->end(); 
     3151 
     3152        for (rit = rays->begin(); rit < rit_end; ++ rit) 
     3153        { 
     3154                VssRay *ray = (*rit).mRay; 
     3155 
     3156                const bool positive = ray->HasPosDir(axis); 
     3157                 
     3158                // if hitpoint with object is inside this node 
     3159                if (GetLeaf(ray->mOrigin, ray->mOriginNode) == leaf) 
     3160                { 
     3161                        pos = ray->mOrigin[axis]; 
     3162         
     3163                        mSplitCandidates->push_back( 
     3164                                SortableEntry(SortableEntry::BOX_INTERSECT,  
     3165                                                          pos,  
     3166                                                          ray->mOriginObject,  
     3167                                                          ray) 
     3168                                                          ); 
     3169                } 
     3170 
     3171                if (GetLeaf(ray->mTermination, ray->mTerminationNode) == leaf) 
     3172                { 
     3173                        pos = ray->mTermination[axis]; 
     3174 
     3175                        mSplitCandidates->push_back( 
     3176                                SortableEntry(SortableEntry::BOX_INTERSECT,  
     3177                                                          pos,  
     3178                                                          ray->mOriginObject,  
     3179                                                          ray) 
     3180                                                          ); 
     3181                } 
     3182        } 
     3183 
     3184 
     3185        //-- insert object queries 
     3186        //-- These queries can induce a change in pvs size. 
     3187        //-- Note that they cannot induce a change in view cell volume, as 
     3188        //-- there is no ray associated with these events!! 
     3189 
     3190        ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
     3191 
     3192    for (oit = leaf->mObjects.begin(); oit != leaf->mObjects.end(); ++ oit )  
     3193        { 
     3194                Intersectable *object = *oit; 
     3195                const AxisAlignedBox3 box = object->GetBox(); 
     3196 
     3197                mSplitCandidates->push_back( 
     3198                        SortableEntry(SortableEntry::BOX_MIN, 
     3199                                                  box.Min(axis), 
     3200                                                  object, 
     3201                                                  NULL) 
     3202                                                  ); 
     3203    
     3204     
     3205                mSplitCandidates->push_back( 
     3206                        SortableEntry(SortableEntry::BOX_MAX, 
     3207                                                  box.Max(axis), 
     3208                                                  object, 
     3209                                                  NULL) 
     3210                                                  ); 
    31463211        } 
    31473212 
     
    31503215 
    31513216 
    3152 float OspTree::PrepareHeuristics(Intersectable *object) 
    3153 { 
    3154         if (mUseEqualWeightForHeuristics) 
    3155         {        
    3156                 // like sah: each object has weight one for heuristics 
    3157                 return 1; 
    3158         } 
    3159         else 
    3160         { 
    3161                 // the priotity of the object is the sum of view cells  
    3162                 // weighted per their volume 
    3163                 float vol = 0; 
    3164                 return vol; 
    3165                 //return object->mViewCellPvs.GetSize(); 
    3166         } 
    3167 } 
    3168  
    3169  
    31703217const OspTreeStatistics &OspTree::GetStatistics() const 
    31713218{ 
     
    31743221 
    31753222 
    3176 float OspTree::PrepareHeuristics(const ObjectContainer &objects) 
     3223float OspTree::PrepareHeuristics(const VssRay &ray) 
     3224{ 
     3225        float vol = 0; 
     3226 
     3227        ViewCellContainer viewCells; 
     3228 
     3229        mVspTree->GetViewCells(ray); 
     3230     
     3231        ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     3232 
     3233        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     3234        { 
     3235                ViewCell *vc = (*vit); 
     3236 
     3237                if (!vc->Mailed()) 
     3238                { 
     3239                        vc->Mail(); 
     3240                        vc->mCounter = 0; 
     3241                        vol += vc->GetVolume(); 
     3242                } 
     3243        } 
     3244 
     3245        return vol; 
     3246} 
     3247 
     3248 
     3249float OspTree::PrepareHeuristics(const OspTraversalData &tData) 
    31773250{        
    31783251        Intersectable::NewMail(); 
     
    31813254        float vol = 0; 
    31823255 
    3183         ObjectContainer::const_iterator oit, oit_end = objects.end(); 
    3184  
    3185         //-- set all view cell volume as belonging to front volume 
    3186         for (oit = objects.begin(); oit != oit_end; ++ oit) 
    3187         { 
    3188                 Intersectable *obj = *oit; 
    3189                 vol += PrepareHeuristics(obj);           
     3256        KdLeaf *leaf = tData.mNode; 
     3257 
     3258        RayInfoContainer::const_iterator rit, rit_end = tData.mRays->end(); 
     3259 
     3260        for (rit = tData.mRays->begin(); rit < rit_end; ++ rit) 
     3261        { 
     3262                VssRay *ray = (*rit).mRay; 
     3263 
     3264                // if hitpoint with one of the objects is inside this node, we 
     3265                // evaluate the volume of the view cells seen by this ray 
     3266                if ((GetLeaf(ray->mOrigin, ray->mOriginNode) == leaf) || 
     3267                        (GetLeaf(ray->mTermination, ray->mTerminationNode) == leaf)) 
     3268                { 
     3269            vol += PrepareHeuristics(ray); 
     3270                } 
    31903271        } 
    31913272 
     
    31943275 
    31953276 
    3196 void OspTree::EvalViewCellVolumeIncr(const SortableEntry &ci, 
    3197                                                                          float &volLeft, 
    3198                                                                          float &volRight) const 
     3277void OspTree::EvalHeuristicsContribution(const SortableEntry &ci, 
     3278                                                                                 float &volLeft, 
     3279                                                                                 float &volRight, 
     3280                                                                                 int &pvsLeft, 
     3281                                                                                 int &pvsRight) 
    31993282{ 
    32003283        Intersectable *obj = ci.mObject; 
     3284        VssRay *ray = ci.mRay; 
    32013285 
    32023286        switch (ci.mType)  
    32033287        { 
     3288                // add reverse pvs to left side of split plane 
    32043289                case SortableEntry::BOX_MIN: 
    3205                         AddContriToPvs(obj, volLeft); 
     3290                        ++ pvsLeft; 
    32063291                        break; 
    32073292                         
    32083293                case SortableEntry::BOX_MAX: 
    3209                         RemoveContriFromPvs(obj, volRight); 
     3294                        -- pvsRight; 
    32103295                        break; 
     3296 
     3297                // compute volume contribution from view cells 
     3298                case SortableEntry::BOX_INTERSECT: 
     3299                        EvalVolumeContribution(*ray, volRight, volLeft); 
     3300                        break; 
     3301                default: 
     3302                        cout << "should not come here" << endl; 
     3303                        break; 
    32113304        } 
    32123305 
     
    32153308 
    32163309 
     3310void OspTree::EvalVolumeContribution(const VssRay &ray, float &volLeft, float &volRight) 
     3311{ 
     3312        ViewCellContainer viewCells; 
     3313 
     3314        mVspTree->GetViewCells(ray, viewCells); 
     3315 
     3316        ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     3317 
     3318        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     3319        { 
     3320                // view cells comes to left child node 
     3321                ViewCell *viewCell = *vit; 
     3322 
     3323                if (!viewCell->Mailed()) 
     3324                { 
     3325                        viewCell->Mail(); 
     3326                        volLeft += viewCell->GetVolume(); 
     3327                } 
     3328 
     3329                // remove from right child node 
     3330 
     3331                if (-- viewCell->mCounter == 0) 
     3332                { 
     3333                        volRight -= viewCell->GetVolume(); 
     3334                } 
     3335        } 
     3336} 
     3337 
     3338 
    32173339void OspTree::SetViewCellsManager(ViewCellsManager *vcm) 
    32183340{ 
     
    32243346{ 
    32253347        return mBoundingBox; 
    3226 } 
    3227  
    3228  
    3229 void OspTree::RemoveContriFromPvs(Intersectable *object, float &pvs) const 
    3230 { 
    3231         if (mUseEqualWeightForHeuristics) 
    3232                 -- pvs; 
    3233         else 
    3234                 // the cost of an object is the number of view cells it is part of 
    3235                 pvs -= object->mViewCellPvs.GetSize(); 
    3236 } 
    3237  
    3238  
    3239 void OspTree::AddContriToPvs(Intersectable *object, float &pvs) const 
    3240 { 
    3241         if (mUseEqualWeightForHeuristics) 
    3242                 ++ pvs; 
    3243         else 
    3244                 // the cost of an object is the number of view cells it is part of 
    3245                 pvs += object->mViewCellPvs.GetSize(); 
    32463348} 
    32473349 
     
    32793381 
    32803382                                nCostRatio[axis] = 
    3281                                         EvalLocalCostHeuristics(tData.mNode, 
     3383                                        EvalLocalCostHeuristics(tData, 
    32823384                                                                           tData.mBoundingBox, 
    32833385                                                                           axis, 
     
    33253427 
    33263428 
    3327 float OspTree::EvalViewCellPvsIncr(Intersectable *object) const 
    3328 { 
    3329         if (mUseEqualWeightForHeuristics) 
    3330                 return 1; 
    3331         else 
    3332                 return (float)object->mViewCellPvs.GetSize(); 
    3333 } 
    3334  
    3335  
    33363429float OspTree::EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 
    33373430                                                                          const OspTraversalData &data) const 
     
    33573450        ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
    33583451 
     3452        //TODO §§matt: have to evaluate view cell volume on left and right cell 
    33593453        for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 
    33603454        { 
     
    33623456                const AxisAlignedBox3 box = obj->GetBox(); 
    33633457                 
    3364                 const float pvsIncr = EvalViewCellPvsIncr(obj); 
    3365                 totalPvs += pvsIncr; 
    3366                 cout << "totalpvs " << totalPvs << " incr " << pvsIncr << endl; 
     3458                ++ totalPvs; 
     3459 
     3460                cout << "totalpvs " << totalPvs << endl; 
    33673461 
    33683462                if (box.Max(candidatePlane.mAxis) > candidatePlane.mPosition) 
    33693463                { 
    3370                         pvsFront += pvsIncr; 
    3371                 } 
    3372                 if (box.Min(candidatePlane.mAxis) > candidatePlane.mPosition) 
    3373                 { 
    3374                         pvsBack += pvsIncr; 
    3375                 } 
    3376         } 
     3464                        ++ pvsFront; 
     3465                } 
     3466                if (box.Min(candidatePlane.mAxis) < candidatePlane.mPosition) 
     3467                { 
     3468                        ++ pvsBack; 
     3469                } 
     3470        } 
     3471 
     3472 
     3473        ViewCell::NewMail(); 
     3474         
     3475        RayInfoContainer::const_iterator rit, rit_end = tData.mRays->end(); 
     3476 
     3477        for (rit = tData.mRays->begin(); rit < rit_end; ++ rit) 
     3478        { 
     3479                VssRay *ray = (*rit).mRay; 
     3480 
     3481                // if hitpoint with one of the objects is inside this node 
     3482                if (GetLeaf(ray->mOrigin, ray->mOriginNode) == leaf) 
     3483                { 
     3484                        if (ray->mOrigin[candidatePlane.mAxis] > candidatePlane.mPosition) 
     3485                        { 
     3486                                // add view cells volume to front        
     3487                                mVspTree->GetViewCells(ray, viewCells); 
     3488 
     3489                                ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     3490 
     3491                                for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     3492                                { 
     3493                                        ViewCell *vc = *vit; 
     3494 
     3495                                        if (!vit->Mailed()) 
     3496                                        { 
     3497                                                vit->Mail(); 
     3498                                                volBack += vc->GetVolume(); 
     3499                                        } 
     3500                                } 
     3501                        } 
     3502                        else 
     3503                        {// TODO matt§§ 
     3504                                // add view cells volume to back 
     3505                                if (ray->mOrigin[candidatePlane.mAxis] < candidatePlane.mPosition) 
     3506                                { 
     3507                                        // add view cells volume to front        
     3508                                        mVspTree->GetViewCells(ray, viewCells); 
     3509 
     3510                                        ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     3511 
     3512                                        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     3513                                        { 
     3514                                                ViewCell *vc = *vit; 
     3515         
     3516                                                if (!vit->Mailed()) 
     3517                                                { 
     3518                                                        vit->Mail(); 
     3519                                                        volBack += vc->GetVolume(); 
     3520                                                } 
     3521                                        } 
     3522                                } 
     3523                        } 
     3524                } 
     3525        } 
     3526 
    33773527 
    33783528 
     
    37763926mVspTree(vspTree), mOspTree(ospTree) 
    37773927{ 
     3928        // cross references 
    37783929        mVspTree.mOspTree = &ospTree; 
     3930        mOspTree.mVspTree = &vspTree; 
    37793931} 
    37803932 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h

    r1135 r1137  
    749749        void AddViewCellReferences(ViewCell *vc) const; 
    750750 
     751        /** Returns view cells of this ray, either taking precomputed cells 
     752                or by recomputation. 
     753        */ 
     754        void GetViewCells(const VssRay &ray, ViewCellContainer &viewCells); 
     755 
    751756 
    752757        /// pointer to the hierarchy of view cells 
     
    900905        /** Computes best cost for axis aligned planes. 
    901906        */ 
    902         float EvalLocalCostHeuristics(const VspTraversalData &data, 
     907        float EvalLocalCostHeuristics(const VspTraversalData &tData, 
    903908                                                                  const AxisAlignedBox3 &box, 
    904909                                                                  const int axis, 
     
    13651370        struct SortableEntry 
    13661371        { 
     1372                /** There is a 3th "event" for rays which intersect a 
     1373                        box in the middle. These "events" don't induce a change in 
     1374                        pvs size, but may induce a change in view cell volume. 
     1375                */ 
    13671376                enum EType  
    13681377                { 
    1369                         ERayMin, 
    1370                         ERayMax 
     1378                        BOX_MIN, 
     1379                        BOX_MAX, 
     1380                        BOX_INTERSECT 
    13711381                }; 
    13721382 
     
    13741384                //int mPvs; 
    13751385                float mPos; 
    1376  
     1386                VssRay *mRay; 
     1387                 
    13771388                Intersectable *mObject; 
    13781389 
    13791390                SortableEntry() {} 
    13801391 
    1381                 SortableEntry(const int type,  
     1392                SortableEntry(const int type, 
    13821393                        //const float pvs,  
    13831394                        const float pos, 
    1384                         Intersectable *obj): 
     1395                        Intersectable *obj, 
     1396                        VssRay *ray): 
    13851397                mType(type),  
    13861398                //mPvs(pvs),  
    13871399                mPos(pos),  
    1388                 mObject(obj)  
     1400                mObject(obj), 
     1401                mRay(ray) 
    13891402                {} 
    13901403 
     
    14171430        float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 
    14181431                                                                 const OspTraversalData &data) const; 
    1419  
    1420         float EvalViewCellPvsIncr(Intersectable *object) const; 
    14211432 
    14221433 
     
    14901501        /** Computes best cost for axis aligned planes. 
    14911502        */ 
    1492         float EvalLocalCostHeuristics(const OspTraversalData &data, 
     1503        float EvalLocalCostHeuristics(const OspTraversalData &tData, 
    14931504                const AxisAlignedBox3 &box, 
    14941505                const int axis, 
     
    15651576        float GetMemUsage() const; 
    15661577 
    1567         /** Evaluates the influence on the pvs of the visibility event ve. 
     1578        /** Evaluates the influence on the pvs of the event. 
    15681579                @param ve the visibility event 
    15691580                @param pvsLeft updates the left pvs 
    15701581                @param rightPvs updates the right pvs 
    15711582        */ 
    1572         void EvalViewCellVolumeIncr(const SortableEntry &ve, 
     1583        void EvalHeuristicsContribution(const SortableEntry &ci, 
    15731584                float &volLeft, 
    1574                 float &volRight) const; 
    1575  
    1576         void RemoveContriFromPvs(Intersectable *object, float &pvs) const; 
    1577         void AddContriToPvs(Intersectable *object, float &pvs) const; 
     1585                float &volRight, 
     1586                int &pvsLeft, 
     1587                int &pvsRight); 
     1588 
     1589        /** Evaluate the contributions of view cell volume of the left and the right view cell. 
     1590        */ 
     1591        void EvalVolumeContribution(const VssRay &ray, float &volLeft, float &volRight); 
    15781592 
    15791593        /** Prepares objects for the cost heuristics. 
    15801594                @returns pvs size of the node 
    15811595        */ 
    1582         float PrepareHeuristics(const ObjectContainer &objects); 
    1583  
    1584         /** Evaluates contribution for one object  
    1585                 to heuristics preparation. 
    1586         */ 
    1587         float PrepareHeuristics(Intersectable *object); 
     1596        float PrepareHeuristics(const OspTraversalData &tData); 
     1597 
     1598        /** Prepares heuristics for a particular ray. 
     1599        */ 
     1600        float PrepareHeuristics(const VssRay &ray); 
    15881601 
    15891602        /** Prepares construction for vsp and osp trees. 
     
    16051618 
    16061619protected: 
     1620 
     1621        VspTree *mVspTree; 
    16071622 
    16081623        /// The view cells manager 
Note: See TracChangeset for help on using the changeset viewer.