Changeset 848
- Timestamp:
- 01/17/08 23:26:01
- Files:
-
- trunk/src/vpb/Destination.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vpb/Destination.cpp
r844 r848 1223 1223 if (!shapeDrawable) return 0; 1224 1224 1225 hf->setSkirtHeight(shapeDrawable->getBound().radius()* 0.01f);1225 hf->setSkirtHeight(shapeDrawable->getBound().radius()*_dataSet->getSkirtRatio()); 1226 1226 1227 1227 osg::StateSet* stateset = createStateSet(); … … 1356 1356 } 1357 1357 1358 1358 1359 osg::HeightField* hf = _terrain->_heightField.get(); 1359 1360 // need to work out what the skirt should be... 1361 hf->setSkirtHeight(0.01f); 1360 osg::EllipsoidModel* em = _dataSet->getEllipsoidModel(); 1362 1361 1363 1362 // set up the locator place the data all in the correction position 1364 1363 osgTerrain::Locator* locator = new osgTerrain::Locator; 1365 locator->setEllipsoidModel( _dataSet->getEllipsoidModel());1364 locator->setEllipsoidModel(em); 1366 1365 1367 1366 if (_dataSet->getDestinationCoordinateSystemNode()) … … 1370 1369 locator->setCoordinateSystem(_dataSet->getDestinationCoordinateSystemNode()->getCoordinateSystem()); 1371 1370 } 1371 1372 1373 double radius = (_extents._max-_extents._min).length()*0.5; 1372 1374 1373 1375 if (_dataSet->getConvertFromGeographicToGeocentric()) … … 1378 1380 osg::DegreesToRadians(_extents.xMax()), 1379 1381 osg::DegreesToRadians(_extents.yMax())); 1382 1383 if (em) 1384 { 1385 double midLong = hf->getOrigin().x() + hf->getXInterval()*((double)(hf->getNumColumns()-1))*0.5; 1386 double midLat = hf->getOrigin().y() + hf->getYInterval()*((double)(hf->getNumRows()-1))*0.5; 1387 1388 double X,Y,Z = hf->getOrigin().z(); 1389 em->convertLatLongHeightToXYZ(osg::DegreesToRadians(midLat),osg::DegreesToRadians(midLong),Z, X,Y,Z); 1390 osg::Vec3d center_position(X,Y,Z); 1391 1392 Z = hf->getOrigin().z(); 1393 em->convertLatLongHeightToXYZ(osg::DegreesToRadians(hf->getOrigin().y()),osg::DegreesToRadians(hf->getOrigin().x()),Z, X,Y,Z); 1394 osg::Vec3d origin(X,Y,Z); 1395 1396 radius = (origin-center_position).length(); 1397 } 1398 1380 1399 } 1381 1400 else … … 1389 1408 // locator->setCoordinateSystemType(osgTerrain::Locator::GEOGRAPHIC); 1390 1409 } 1410 1411 // need to work out what the skirt should be... 1412 hf->setSkirtHeight(radius*_dataSet->getSkirtRatio()); 1391 1413 1392 1414 // create the terrain node that we'll hang the height field off
