420 |
|
) |
421 |
|
{ |
422 |
|
/* set up ray */ |
423 |
– |
rayorigin(&thisray, PRIMARY, NULL, NULL); |
423 |
|
if (imm_irrad) { |
424 |
|
VSUM(thisray.rorg, org, dir, 1.1e-4); |
425 |
|
thisray.rdir[0] = -dir[0]; |
426 |
|
thisray.rdir[1] = -dir[1]; |
427 |
|
thisray.rdir[2] = -dir[2]; |
428 |
|
thisray.rmax = 0.0; |
430 |
– |
thisray.revf = rayirrad; |
429 |
|
} else { |
430 |
|
VCOPY(thisray.rorg, org); |
431 |
|
VCOPY(thisray.rdir, dir); |
432 |
|
thisray.rmax = dmax; |
435 |
– |
if (castonly) |
436 |
– |
thisray.revf = raycast; |
433 |
|
} |
434 |
+ |
rayorigin(&thisray, PRIMARY, NULL, NULL); |
435 |
+ |
if (imm_irrad) |
436 |
+ |
thisray.revf = rayirrad; |
437 |
+ |
else if (castonly) |
438 |
+ |
thisray.revf = raycast; |
439 |
|
if (ray_pnprocs > 1) { /* multiprocessing FIFO? */ |
440 |
|
if (ray_fifo_in(&thisray) < 0) |
441 |
|
error(USER, "lost children"); |
766 |
|
|
767 |
|
|
768 |
|
static void |
769 |
< |
oputp( /* print point */ |
769 |
> |
oputp( /* print intersection point */ |
770 |
|
RAY *r |
771 |
|
) |
772 |
|
{ |
773 |
< |
if (r->rot < FHUGE*.99) |
773 |
< |
(*putreal)(r->rop, 3); |
774 |
< |
else |
775 |
< |
(*putreal)(vdummy, 3); |
773 |
> |
(*putreal)(r->rop, 3); /* set to ray origin if distant or no hit */ |
774 |
|
} |
775 |
|
|
776 |
|
|
779 |
|
RAY *r |
780 |
|
) |
781 |
|
{ |
782 |
< |
if (r->rot < FHUGE*.99) { |
785 |
< |
if (r->rflips & 1) { /* undo any flippin' flips */ |
786 |
< |
FVECT unrm; |
787 |
< |
unrm[0] = -r->ron[0]; |
788 |
< |
unrm[1] = -r->ron[1]; |
789 |
< |
unrm[2] = -r->ron[2]; |
790 |
< |
(*putreal)(unrm, 3); |
791 |
< |
} else |
792 |
< |
(*putreal)(r->ron, 3); |
793 |
< |
} else |
782 |
> |
if (r->ro == NULL) { /* zero vector if clipped or no hit */ |
783 |
|
(*putreal)(vdummy, 3); |
784 |
+ |
return; |
785 |
+ |
} |
786 |
+ |
if (r->rflips & 1) { /* undo any flippin' flips */ |
787 |
+ |
FVECT unrm; |
788 |
+ |
unrm[0] = -r->ron[0]; |
789 |
+ |
unrm[1] = -r->ron[1]; |
790 |
+ |
unrm[2] = -r->ron[2]; |
791 |
+ |
(*putreal)(unrm, 3); |
792 |
+ |
} else |
793 |
+ |
(*putreal)(r->ron, 3); |
794 |
|
} |
795 |
|
|
796 |
|
|
801 |
|
{ |
802 |
|
FVECT pnorm; |
803 |
|
|
804 |
< |
if (r->rot >= FHUGE*.99) { |
804 |
> |
if (r->ro == NULL) { /* clipped or no hit */ |
805 |
|
(*putreal)(vdummy, 3); |
806 |
|
return; |
807 |
|
} |