Changeset 899

Show
Ignore:
Timestamp:
03/19/08 17:10:09
Author:
robert
Message:

Fixed error in intersection with height field code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vpb/DataSet.cpp

    r898 r899  
    11161116    if (getBuildOptionsString().find("old_dg")!=std::string::npos) 
    11171117    { 
     1118        log(osg::NOTICE,"Old DataSet::createDestinationGraph() selected");  
     1119     
    11181120        _destinationGraph = createDestinationGraph(0, 
    11191121                                                   _intermediateCoordinateSystem.get(), 
  • trunk/src/vpb/HeightFieldMapper.cpp

    r875 r899  
    723723     
    724724    if ((c>=0 && c<_hf.getNumColumns()) && (r>=0 && r<_hf.getNumRows()))  
    725     {   
    726         total_ratio = (1.0-rx)*(1.0-ry)
    727         total_height = _hf.getHeight(c,r)
     725    {  double local_ratio = (1.0-rx)*(1.0-ry); 
     726        total_ratio += local_ratio
     727        total_height += _hf.getHeight(c,r)*local_ratio
    728728    } 
    729729     
    730730    if (((c+1)>=0 && (c+1)<_hf.getNumColumns()) && (r>=0 && r<_hf.getNumRows())) 
    731731    {   
    732         total_ratio = rx*(1.0-ry); 
    733         total_height = _hf.getHeight(c+1,r); 
     732        double local_ratio = rx*(1.0-ry); 
     733        total_ratio += local_ratio; 
     734        total_height += _hf.getHeight(c+1,r)*local_ratio; 
    734735    } 
    735736 
    736737    if ((c>=0 && c<_hf.getNumColumns()) && ((r+1)>=0 && (r+1)<_hf.getNumRows())) 
    737738    {   
    738         total_ratio = (1.0-rx)*ry; 
    739         total_height = _hf.getHeight(c,r+1); 
     739        double local_ratio = (1.0-rx)*ry; 
     740        total_ratio += local_ratio; 
     741        total_height += _hf.getHeight(c,r+1)*local_ratio; 
    740742    } 
    741743 
    742744    if (((c+1)>=0 && (c+1)<_hf.getNumColumns()) && ((r+1)>=0 && (r+1)<_hf.getNumRows())) 
    743745    {   
    744         total_ratio = rx*ry; 
    745         total_height = _hf.getHeight(c+1,r+1); 
     746        double local_ratio = rx*ry; 
     747        total_ratio += local_ratio; 
     748        total_height += _hf.getHeight(c+1,r+1)*local_ratio; 
    746749    } 
    747750