From bae46a0fbd1f2c1db99031aaad8ee6b11c36e325 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 14 Nov 2006 12:55:00 +0000 Subject: [PATCH] From Jason Beverage, "I ran though the sample data that Gert provided earlier today and tracked down the problem. The xoffset in readHeightField and readImage were being applied even in projected coordinate systems. This patch should fix the issue." --- src/osgTerrain/DataSet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgTerrain/DataSet.cpp b/src/osgTerrain/DataSet.cpp index f1d2f3dbe..ccc86a9ed 100644 --- a/src/osgTerrain/DataSet.cpp +++ b/src/osgTerrain/DataSet.cpp @@ -517,7 +517,7 @@ void DataSet::SourceData::readImage(DestinationData& destination) // note, we have to handle the possibility of goegraphic datasets wrapping over on themselves when they pass over the dateline // to do this we have to test geographic datasets via two passes, each with a 360 degree shift of the source cata. - double xoffset = d_bb.xMin() < s_bb.xMin() ? -360.0 : 0.0; + double xoffset = ((d_bb.xMin() < s_bb.xMin()) && (d_bb._isGeographic)) ? -360.0 : 0.0; unsigned int numXChecks = d_bb._isGeographic ? 2 : 1; for(unsigned int ic = 0; ic < numXChecks; ++ic, xoffset += 360.0) { @@ -875,7 +875,7 @@ void DataSet::SourceData::readHeightField(DestinationData& destination) // note, we have to handle the possibility of goegraphic datasets wrapping over on themselves when they pass over the dateline // to do this we have to test geographic datasets via two passes, each with a 360 degree shift of the source cata. - double xoffset = d_bb.xMin() < s_bb.xMin() ? -360.0 : 0.0; + double xoffset = ((d_bb.xMin() < s_bb.xMin()) && (d_bb._isGeographic)) ? -360.0 : 0.0; unsigned int numXChecks = d_bb._isGeographic ? 2 : 1; for(unsigned int ic = 0; ic < numXChecks; ++ic, xoffset += 360.0) {