| 203 |
|
VIEW *nv; |
| 204 |
|
{ |
| 205 |
|
if (nv->type == VT_PAR || /* check view legality */ |
| 206 |
< |
nv->horiz > 160. || nv->vert > 160.) { |
| 206 |
> |
nv->horiz > 160. || nv->vert > 160.) { |
| 207 |
|
error(COMMAND, "illegal view type/angle"); |
| 208 |
|
nv->type = VT_PER; |
| 209 |
|
nv->horiz = odev.v.horiz; |
| 222 |
|
int dh = DisplayHeight(ourdisplay,ourscreen); |
| 223 |
|
|
| 224 |
|
dw -= 25; /* for window frame */ |
| 225 |
< |
dh -= 100; |
| 225 |
> |
dh -= 50; |
| 226 |
|
odev.hres = 2.*VIEWDIST/pwidth * |
| 227 |
|
tan(PI/180./2.*nv->horiz); |
| 228 |
|
odev.vres = 2.*VIEWDIST/pheight * |
| 472 |
|
int dx, dy, mov, orb; |
| 473 |
|
{ |
| 474 |
|
VIEW nv; |
| 475 |
< |
FVECT v1; |
| 475 |
> |
FVECT odir, v1; |
| 476 |
|
double d; |
| 477 |
|
register int li; |
| 478 |
|
/* start with old view */ |
| 481 |
|
if (mov | orb) { |
| 482 |
|
if ((li = qtFindLeaf(dx, dy)) < 0) |
| 483 |
|
return(0); /* not on window */ |
| 484 |
< |
VSUM(nv.vdir, qtL.wp[li], nv.vp, -1.); |
| 484 |
> |
VSUM(odir, qtL.wp[li], nv.vp, -1.); |
| 485 |
|
} else { |
| 486 |
|
if (viewray(nv.vp, nv.vdir, &odev.v, |
| 487 |
|
(dx+.5)/odev.hres, (dy+.5)/odev.vres) < -FTINY) |
| 488 |
|
return(0); /* outside view */ |
| 489 |
|
} |
| 490 |
|
if (orb && mov) { /* orbit left/right */ |
| 491 |
< |
spinvector(nv.vdir, nv.vdir, nv.vup, MOVDEG*PI/180.*mov); |
| 492 |
< |
VSUM(nv.vp, qtL.wp[li], nv.vdir, -1.); |
| 491 |
> |
spinvector(odir, odir, nv.vup, d=MOVDEG*PI/180.*mov); |
| 492 |
> |
VSUM(nv.vp, qtL.wp[li], odir, -1.); |
| 493 |
> |
spinvector(nv.vdir, nv.vdir, nv.vup, d); |
| 494 |
|
} else if (orb) { /* orbit up/down */ |
| 495 |
< |
fcross(v1, nv.vdir, nv.vup); |
| 495 |
> |
fcross(v1, odir, nv.vup); |
| 496 |
|
if (normalize(v1) == 0.) |
| 497 |
|
return(0); |
| 498 |
< |
spinvector(nv.vdir, nv.vdir, v1, MOVDEG*PI/180.*orb); |
| 499 |
< |
VSUM(nv.vp, qtL.wp[li], nv.vdir, -1.); |
| 498 |
> |
spinvector(odir, odir, v1, d=MOVDEG*PI/180.*orb); |
| 499 |
> |
VSUM(nv.vp, qtL.wp[li], odir, -1.); |
| 500 |
> |
spinvector(nv.vdir, nv.vdir, v1, d); |
| 501 |
|
} else if (mov) { /* move forward/backward */ |
| 502 |
|
d = MOVPCT/100. * mov; |
| 503 |
< |
VSUM(nv.vp, nv.vp, nv.vdir, d); |
| 503 |
> |
VSUM(nv.vp, nv.vp, odir, d); |
| 504 |
|
} |
| 505 |
|
if (!mov ^ !orb && headlocked) { /* restore head height */ |
| 506 |
|
VSUM(v1, odev.v.vp, nv.vp, -1.); |