From Jean-Sebastien, "In my auto-build today there are 3 errors caused by using a ref_ptr<T> in a function taking a T* when building without the implicit conversion."

This commit is contained in:
Robert Osfield 2010-12-23 09:59:35 +00:00
parent 410b4fd109
commit 8202ccc679

View File

@ -198,14 +198,14 @@ int main(int argc, char** argv)
return 1;
}
osg::ref_ptr<osgTerrain::Terrain> terrain = findTopMostNodeOfType<osgTerrain::Terrain>(rootnode);
osg::ref_ptr<osgTerrain::Terrain> terrain = findTopMostNodeOfType<osgTerrain::Terrain>(rootnode.get());
if (!terrain)
{
// no Terrain node present insert one above the loaded model.
terrain = new osgTerrain::Terrain;
// if CoordinateSystemNode is present copy it's contents into the Terrain, and discard it.
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(rootnode);;
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(rootnode.get());
if (csn)
{
terrain->set(*csn);
@ -227,7 +227,7 @@ int main(int argc, char** argv)
terrain->setBlendingPolicy(blendingPolicy);
// register our custom handler for adjust Terrain settings
viewer.addEventHandler(new TerrainHandler(terrain));
viewer.addEventHandler(new TerrainHandler(terrain.get()));
// add a viewport to the viewer and attach the scene graph.
viewer.setSceneData( rootnode.get() );