Ignore:
Timestamp:
07/10/06 19:21:19 (18 years ago)
Author:
bittner
Message:

Merge with Olivers code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h

    r860 r1112  
    317317public: 
    318318   
    319   float mSumPdf; 
    320    
    321   SimpleRayContainer():vector<SimpleRay>(), mSumPdf(0.0f) {} 
    322    
    323   void NormalizePdf() { 
     319   
     320  SimpleRayContainer():vector<SimpleRay>() {} 
     321   
     322  void NormalizePdf(float scale = 1.0f) { 
    324323        iterator it = begin(); 
    325         float c = 1.0f/mSumPdf; 
     324        float sumPdf = 0.0f; 
    326325        for (; it != end(); it++) 
     326          sumPdf += (*it).mPdf; 
     327 
     328        float c = scale/sumPdf; 
     329         
     330        for (it = begin(); it != end(); it++) { 
    327331          (*it).mPdf*=c; 
    328   } 
    329  
     332        } 
     333  } 
     334   
    330335  void AddRay(const SimpleRay &ray) { 
    331336        push_back(ray); 
    332         mSumPdf += ray.mPdf; 
    333337  } 
    334338}; 
Note: See TracChangeset for help on using the changeset viewer.