diff --git a/src/osgTerrain/Locator.cpp b/src/osgTerrain/Locator.cpp index ef7b91369..194bec5d4 100644 --- a/src/osgTerrain/Locator.cpp +++ b/src/osgTerrain/Locator.cpp @@ -85,7 +85,14 @@ bool Locator::computeLocalBounds(Locator& source, osg::Vec3d& bottomLeft, osg::V if (corners.empty()) return false; - for(Corners::iterator itr = corners.begin(); + Corners::iterator itr = corners.begin(); + + bottomLeft.x() = topRight.x() = itr->x(); + bottomLeft.y() = topRight.y() = itr->y(); + + ++itr; + + for(; itr != corners.end(); ++itr) { diff --git a/src/osgVolume/Locator.cpp b/src/osgVolume/Locator.cpp index 77c5e75fd..a623deb4e 100644 --- a/src/osgVolume/Locator.cpp +++ b/src/osgVolume/Locator.cpp @@ -12,6 +12,8 @@ */ #include +#include +#include #include @@ -107,6 +109,8 @@ bool Locator::computeLocalBounds(Locator& source, osg::Vec3d& bottomLeft, osg::V bool Locator::computeLocalBounds(osg::Vec3d& bottomLeft, osg::Vec3d& topRight) const { + osg::notify(osg::NOTICE)<<"Locator::computeLocalBounds"< Corners; Corners corners; @@ -153,7 +157,15 @@ bool Locator::computeLocalBounds(osg::Vec3d& bottomLeft, osg::Vec3d& topRight) c if (corners.empty()) return false; - for(Corners::iterator itr = corners.begin(); + Corners::iterator itr = corners.begin(); + + bottomLeft.x() = topRight.x() = itr->x(); + bottomLeft.y() = topRight.y() = itr->y(); + bottomLeft.z() = topRight.z() = itr->z(); + + ++itr; + + for(; itr != corners.end(); ++itr) {