589 |
|
if (usematrix) { |
590 |
|
pos[0] += theirview.hoff - .5; |
591 |
|
pos[1] += theirview.voff - .5; |
592 |
+ |
if (normdist && theirview.type == VT_PER) |
593 |
+ |
d = sqrt(1. + pos[0]*pos[0]*theirview.hn2 |
594 |
+ |
+ pos[1]*pos[1]*theirview.vn2); |
595 |
+ |
else |
596 |
+ |
d = 1.; |
597 |
+ |
pos[2] += d*theirview.vfore; |
598 |
|
if (theirview.type == VT_PER) { |
599 |
< |
if (normdist) /* adjust distance */ |
594 |
< |
pos[2] /= sqrt(1. + pos[0]*pos[0]*theirview.hn2 |
595 |
< |
+ pos[1]*pos[1]*theirview.vn2); |
599 |
> |
pos[2] /= d; |
600 |
|
pos[0] *= pos[2]; |
601 |
|
pos[1] *= pos[2]; |
602 |
|
} |
603 |
|
multp3(pos, pos, theirs2ours); |
604 |
< |
if (pos[2] <= 0) |
604 |
> |
if (pos[2] <= ourview.vfore) |
605 |
|
return(0); |
606 |
|
if (ourview.type == VT_PER) { |
607 |
|
pos[0] /= pos[2]; |
609 |
|
} |
610 |
|
pos[0] += .5 - ourview.hoff; |
611 |
|
pos[1] += .5 - ourview.voff; |
612 |
+ |
pos[2] -= ourview.vfore; |
613 |
|
} else { |
614 |
|
if (viewray(pt, tdir, &theirview, pos[0], pos[1]) < -FTINY) |
615 |
|
return(0); |