Skip to content

Commit

Permalink
Fix for prime meridian/180th meridian
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielwarner committed Oct 23, 2020
1 parent 31ed721 commit 41aaf44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions simgear-2020.3.patch
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ index 7177f87e..47a02dc3 100644
PrimitiveUtils.cxx
diff --git a/simgear/scene/util/OrthophotoManager.cxx b/simgear/scene/util/OrthophotoManager.cxx
new file mode 100644
index 00000000..ae69c6df
index 00000000..62cb9c42
--- /dev/null
+++ b/simgear/scene/util/OrthophotoManager.cxx
@@ -0,0 +1,341 @@
@@ -0,0 +1,340 @@
+// OrthophotoManager.cxx -- manages satellite orthophotos
+//
+// Copyright (C) 2020 Nathaniel MacArthur-Warner nathanielwarner77@gmail.com
Expand Down Expand Up @@ -340,8 +340,7 @@ index 00000000..ae69c6df
+ if (_minPosLon <= 180 && _maxPosLon >= 0 && _minNegLon < 0 && _maxNegLon >= -180) {
+ // We have negative and positive longitudes.
+ // Choose whether we're straddling the Prime Meridian or 180th meridian
+ // based on which produces a smaller bounding box.
+ if (_maxPosLon - _minNegLon <= _maxNegLon - _minPosLon) {
+ if (_maxPosLon - _minNegLon < 180) {
+ _hemisphere = StraddlingPm;
+ } else {
+ _hemisphere = StraddlingIdl;
Expand Down
7 changes: 3 additions & 4 deletions simgear-next.patch
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ index 09e225c0..f5823550 100644
PrimitiveUtils.cxx
diff --git a/simgear/scene/util/OrthophotoManager.cxx b/simgear/scene/util/OrthophotoManager.cxx
new file mode 100644
index 00000000..ae69c6df
index 00000000..62cb9c42
--- /dev/null
+++ b/simgear/scene/util/OrthophotoManager.cxx
@@ -0,0 +1,341 @@
@@ -0,0 +1,340 @@
+// OrthophotoManager.cxx -- manages satellite orthophotos
+//
+// Copyright (C) 2020 Nathaniel MacArthur-Warner nathanielwarner77@gmail.com
Expand Down Expand Up @@ -338,8 +338,7 @@ index 00000000..ae69c6df
+ if (_minPosLon <= 180 && _maxPosLon >= 0 && _minNegLon < 0 && _maxNegLon >= -180) {
+ // We have negative and positive longitudes.
+ // Choose whether we're straddling the Prime Meridian or 180th meridian
+ // based on which produces a smaller bounding box.
+ if (_maxPosLon - _minNegLon <= _maxNegLon - _minPosLon) {
+ if (_maxPosLon - _minNegLon < 180) {
+ _hemisphere = StraddlingPm;
+ } else {
+ _hemisphere = StraddlingIdl;
Expand Down

0 comments on commit 41aaf44

Please sign in to comment.