320 |
|
RAY *r |
321 |
|
) |
322 |
|
{ |
323 |
+ |
void (*old_revf)(RAY *) = r->revf; |
324 |
+ |
|
325 |
|
r->rot = 1e-5; /* pretend we hit surface */ |
326 |
|
VSUM(r->rop, r->rorg, r->rdir, r->rot); |
327 |
|
r->ron[0] = -r->rdir[0]; |
329 |
|
r->ron[2] = -r->rdir[2]; |
330 |
|
r->rod = 1.0; |
331 |
|
/* compute result */ |
332 |
+ |
r->revf = raytrace; |
333 |
|
(*ofun[Lamb.otype].funp)(&Lamb, r); |
334 |
+ |
r->revf = old_revf; |
335 |
|
} |
336 |
|
|
337 |
|
|
342 |
|
double dmax |
343 |
|
) |
344 |
|
{ |
345 |
< |
if (imm_irrad) { /* set up ray */ |
345 |
> |
/* set up ray */ |
346 |
> |
rayorigin(&thisray, PRIMARY, NULL, NULL); |
347 |
> |
if (imm_irrad) { |
348 |
|
VSUM(thisray.rorg, org, dir, 1.1e-4); |
349 |
|
thisray.rdir[0] = -dir[0]; |
350 |
|
thisray.rdir[1] = -dir[1]; |
351 |
|
thisray.rdir[2] = -dir[2]; |
352 |
|
thisray.rmax = 0.0; |
353 |
+ |
thisray.revf = rayirrad; |
354 |
|
} else { |
355 |
|
VCOPY(thisray.rorg, org); |
356 |
|
VCOPY(thisray.rdir, dir); |
357 |
|
thisray.rmax = dmax; |
358 |
+ |
if (castonly) |
359 |
+ |
thisray.revf = raycast; |
360 |
|
} |
352 |
– |
rayorigin(&thisray, PRIMARY, NULL, NULL); |
353 |
– |
/* special case evaluators */ |
354 |
– |
if (castonly) |
355 |
– |
thisray.revf = raycast; |
356 |
– |
else if (imm_irrad) |
357 |
– |
thisray.revf = rayirrad; |
358 |
– |
|
361 |
|
if (ray_pnprocs > 1) { /* multiprocessing FIFO? */ |
362 |
|
if (ray_fifo_in(&thisray) < 0) |
363 |
|
error(USER, "lost children"); |