Changeset 878

Show
Ignore:
Timestamp:
02/15/08 17:04:43
Author:
robert
Message:

Changed the compute the of the grid origin and xy interval to be done locally in doubles to fix precision issues when working with high rest polygonal tiles

Files:

Legend:

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

    r877 r878  
    14961496    else 
    14971497    { 
    1498         unsigned int minimumSize = 8
     1498        unsigned int minimumSize = 4
    14991499        unsigned int numColumns = minimumSize; 
    15001500        unsigned int numRows = minimumSize; 
     
    15201520        grid->allocate(numColumns,numRows); 
    15211521        grid->setOrigin(osg::Vec3(_extents.xMin(),_extents.yMin(),0.0f)); 
    1522         grid->setXInterval((_extents.xMax()-_extents.xMin())/(float)(numColumns-1)); 
    1523         grid->setYInterval((_extents.yMax()-_extents.yMin())/(float)(numRows-1));  
     1522        grid->setXInterval(double(_extents.xMax()-_extents.xMin())/double(numColumns-1)); 
     1523        grid->setYInterval(double(_extents.yMax()-_extents.yMin())/double(numRows-1));  
    15241524         
    15251525        if (!_terrain) _terrain = new DestinationData(_dataSet); 
     
    16361636     
    16371637    // populate the vertex/normal/texcoord arrays from the grid. 
    1638     double orig_X = grid->getOrigin().x(); 
    1639     double delta_X = grid->getXInterval(); 
    1640     double orig_Y = grid->getOrigin().y()
    1641     double delta_Y = grid->getYInterval(); 
    1642     double orig_Z = grid->getOrigin().z(); 
    1643  
     1638    double orig_X = _extents.xMin(); 
     1639    double orig_Y = _extents.yMin(); 
     1640    double orig_Z = 0.0
     1641 
     1642    double delta_X = double(_extents.xMax()-_extents.xMin())/double(numColumns-1); 
     1643    double delta_Y = double(_extents.yMax()-_extents.yMin())/double(numRows-1); 
    16441644 
    16451645    float min_dot_product = 1.0f;