Ignore:
Timestamp:
06/07/06 10:59:55 (18 years ago)
Author:
mattausch
Message:

debug run: fixing memory holes

File:
1 edited

Legend:

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

    r931 r1002  
    2222VssPreprocessor::VssPreprocessor(): 
    2323  mPass(0), 
    24   mVssRays() 
     24  mVssRays(), 
     25  mViewSpaceBox(NULL) 
    2526{ 
    2627  // this should increase coherence of the samples 
     
    543544 
    544545 
    545   AxisAlignedBox3 *box = new AxisAlignedBox3(mKdTree->GetBox()); 
     546  AxisAlignedBox3 box(mKdTree->GetBox()); 
    546547   
    547548  if (!useViewspacePlane) { 
    548549        float size = 0.05f; 
    549550        float s = 0.5f - size; 
    550         float olds = Magnitude(box->Size()); 
    551         box->Enlarge(box->Size()*Vector3(-s)); 
     551        float olds = Magnitude(box.Size()); 
     552        box.Enlarge(box.Size()*Vector3(-s)); 
    552553        Vector3 translation = Vector3(-olds*0.1f, 0, 0); 
    553         box->SetMin(box->Min() + translation); 
    554         box->SetMax(box->Max() + translation); 
     554        box.SetMin(box.Min() + translation); 
     555        box.SetMax(box.Max() + translation); 
    555556  } else { 
    556557 
    557558        // sample city like heights 
    558         box->SetMin(1, box->Min(1) + box->Size(1)*0.2f); 
    559         box->SetMax(1, box->Min(1) + box->Size(1)*0.3f); 
     559        box.SetMin(1, box.Min(1) + box.Size(1)*0.2f); 
     560        box.SetMax(1, box.Min(1) + box.Size(1)*0.3f); 
    560561  } 
    561562 
    562563  if (use2dSampling) 
    563         box->SetMax(1, box->Min(1)); 
     564        box.SetMax(1, box.Min(1)); 
    564565 
    565566  cout<<"mUseViewSpaceBox="<<mUseViewSpaceBox<<endl; 
     
    570571          if (!mEnlargeViewSpace) 
    571572          { 
    572                   mViewSpaceBox = box; 
     573                  mViewSpaceBox = new AxisAlignedBox3(box); 
    573574          } 
    574575          else 
     
    591592                  { 
    592593                          // $$ JB temporary 
    593                           AxisAlignedBox3 box = *mViewSpaceBox; 
     594                          AxisAlignedBox3 tempbox = *mViewSpaceBox; 
    594595                           
    595                           float s = box.Size(0); 
     596                          float s = tempbox.Size(0); 
    596597                           
    597                           box.Scale(0.8f); 
    598                           box.SetMax(0, box.Max(0) + s*0.8f); 
    599                           box.SetMin(0, box.Min(0) + s*0.8f); 
    600                           *mViewSpaceBox = box; 
     598                          tempbox.Scale(0.8f); 
     599                          tempbox.SetMax(0, box.Max(0) + s*0.8f); 
     600                          tempbox.SetMin(0, box.Min(0) + s*0.8f); 
     601                          *mViewSpaceBox = tempbox; 
    601602                  }              
    602603          } 
Note: See TracChangeset for help on using the changeset viewer.