summaryrefslogtreecommitdiff
path: root/src/Panorama.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-14 17:54:58 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-14 17:54:58 +0000
commit820bc8b679188e4c4ab88f62cbde886fe240d36d (patch)
treef79e029c2301bc9804c7663a9b542948ff347621 /src/Panorama.cxx
parentcb69ce80f60b07e152ca464c2c08eaeb3b159ec6 (diff)
fix
fix
Diffstat (limited to 'src/Panorama.cxx')
-rw-r--r--src/Panorama.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index 995b5ec..256b07d 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Panorama.cxx,v 1.4 2005/04/13 22:24:53 hofmann Exp $"
+// "$Id: Panorama.cxx,v 1.5 2005/04/14 19:54:58 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -111,7 +111,7 @@ Panorama::get_visible_mountains() {
int
Panorama::get_x(Mountain *m) {
- return (int) (tan(m->alph - a_center) * scale);
+ return (int) (tan(m->a_view) * scale);
}
int
@@ -165,7 +165,7 @@ Panorama::get_pos(const char *name, double *phi, double *lam) {
double p, l;
while (m) {
- if (strstr(m->name, name)) {
+ if (strcmp(m->name, name) == 0) {
p = m->phi;
l = m->lam;
@@ -195,10 +195,16 @@ Panorama::update_visible_mountains() {
> height_dist_ratio)) {
m->alph = alpha(m->phi, m->lam);
-
- if (m->alph - a_center < pi / 2.0 &&
- m->alph - a_center > - pi / 2.0) {
- // fprintf(stderr, "==> %s\n", m->name);
+ m->a_view = m->alph - a_center;
+ if (m->a_view > pi) {
+ m->a_view -= 2.0*pi;
+ } else if (m->a_view < -pi) {
+ m->a_view += 2.0*pi;
+ }
+
+ // fprintf(stderr, "==> %s %f, dist %f km %f\n", m->name, m->alph, distance(m->phi, m->lam)* 6368, m->a_view);
+ if (m->a_view < pi / 2.0 &&
+ m->a_view > - pi / 2.0) {
m->x = get_x(m);
m->clear_next_visible();