92 |
|
{ |
93 |
|
if (ray_pnprocs > 0) /* close children if any */ |
94 |
|
ray_pclose(0); |
95 |
+ |
else if (ray_pnprocs < 0) |
96 |
+ |
_exit(code); /* avoid flush() in child */ |
97 |
|
#ifndef NON_POSIX |
98 |
< |
else if (!ray_pnprocs) { |
98 |
> |
else { |
99 |
|
headclean(); /* delete header file */ |
100 |
|
pfclean(); /* clean up persist files */ |
101 |
|
} |
166 |
|
if (nproc > 1) { /* start multiprocessing */ |
167 |
|
ray_popen(nproc); |
168 |
|
ray_fifo_out = printvals; |
167 |
– |
ray_pnbatch = 1; /* optimize for throughput */ |
169 |
|
} |
170 |
|
if (hresolu > 0) { |
171 |
|
if (vresolu > 0) |
765 |
|
|
766 |
|
|
767 |
|
static void |
768 |
< |
oputp( /* print point */ |
768 |
> |
oputp( /* print intersection point */ |
769 |
|
RAY *r |
770 |
|
) |
771 |
|
{ |
772 |
< |
if (r->rot < FHUGE*.99) |
772 |
< |
(*putreal)(r->rop, 3); |
773 |
< |
else |
774 |
< |
(*putreal)(vdummy, 3); |
772 |
> |
(*putreal)(r->rop, 3); /* set to ray origin if distant or no hit */ |
773 |
|
} |
774 |
|
|
775 |
|
|
778 |
|
RAY *r |
779 |
|
) |
780 |
|
{ |
781 |
< |
if (r->rot < FHUGE*.99) { |
784 |
< |
if (r->rflips & 1) { /* undo any flippin' flips */ |
785 |
< |
FVECT unrm; |
786 |
< |
unrm[0] = -r->ron[0]; |
787 |
< |
unrm[1] = -r->ron[1]; |
788 |
< |
unrm[2] = -r->ron[2]; |
789 |
< |
(*putreal)(unrm, 3); |
790 |
< |
} else |
791 |
< |
(*putreal)(r->ron, 3); |
792 |
< |
} else |
781 |
> |
if (r->ro == NULL) { /* zero vector if clipped or no hit */ |
782 |
|
(*putreal)(vdummy, 3); |
783 |
+ |
return; |
784 |
+ |
} |
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 |
|
} |
794 |
|
|
795 |
|
|
800 |
|
{ |
801 |
|
FVECT pnorm; |
802 |
|
|
803 |
< |
if (r->rot >= FHUGE*.99) { |
803 |
> |
if (r->ro == NULL) { /* clipped or no hit */ |
804 |
|
(*putreal)(vdummy, 3); |
805 |
|
return; |
806 |
|
} |