Ignore:
Timestamp:
08/30/06 04:39:53 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp

    r1233 r1297  
    543543        float sum = pvsBack*(position - minBox) + pvsFront*(maxBox - position); 
    544544        float newCost = ct_div_ci + sum/sizeBox; 
    545         float oldCost = pvsSize; 
     545        float oldCost = (float)pvsSize; 
    546546        ratio = newCost/oldCost; 
     547 
    547548  } else { 
    548549        // importance based cost 
     
    559560#else 
    560561#if 1 
    561         float newCost = raysBack*pvsBack  + raysFront*pvsFront; 
     562        float newCost = float(raysBack*pvsBack  + raysFront*pvsFront); 
    562563        float oldCost = (float)leaf->rays.size()*pvsSize; 
    563564        ratio = newCost/oldCost; 
     
    807808  float maxBand = minBox + 0.9*(maxBox - minBox); 
    808809         
    809   float minRatio = 1e20; 
     810  float minRatio = 1e20f; 
    810811         
    811812  Intersectable::NewMail(); 
     
    16631664          VssTreeLeaf *leaf = (VssTreeLeaf *)node; 
    16641665          float c = leaf->GetImportance(); 
    1665           int num = (c*ratioPerLeaf + 0.5); 
     1666          int num = (c*ratioPerLeaf + 0.5f); 
    16661667          //                    cout<<num<<" "; 
    16671668 
     
    17201721{ 
    17211722  int nrays = (int)leaf->rays.size(); 
    1722   for (int i=0; i < numberOfRays; i++) { 
     1723  for (int i = 0; i < numberOfRays; ++ i) { 
    17231724        // pickup 3 random rays 
    1724         int r1 = (int)RandomValue(0, nrays-1); 
    1725         int r2 = (int)RandomValue(0, nrays-1); 
    1726         int r3 = (int)RandomValue(0, nrays-1); 
     1725        int r1 = (int)RandomValue(0, (float)(nrays-1)); 
     1726        int r2 = (int)RandomValue(0, (float)(nrays-1)); 
     1727        int r3 = (int)RandomValue(0, (float)(nrays-1)); 
    17271728                 
    17281729        Vector3 o1 = leaf->rays[r1].Extrap(RandomValue(leaf->rays[r1].GetMinT(),  
Note: See TracChangeset for help on using the changeset viewer.