309 |
|
FVECT onorm; |
310 |
|
FVECT offsdir; |
311 |
|
SRCINDEX si; |
312 |
< |
double or, d; |
312 |
> |
double or, d, d1; |
313 |
|
int stestlim, ssn; |
314 |
|
int nhit, nok; |
315 |
|
register int i, n; |
361 |
|
sr.rdir[i] = -onorm[i]; |
362 |
|
} |
363 |
|
sr.rmax = 0.0; |
364 |
< |
rayorigin(&sr, NULL, PRIMARY, 1.0); |
364 |
> |
rayorigin(&sr, PRIMARY, NULL, NULL); |
365 |
|
} while (!(*ofun[o->otype].funp)(o, &sr)); |
366 |
|
/* check against source */ |
367 |
|
VCOPY(sr.rorg, sr.rop); /* starting from intersection */ |
375 |
|
} |
376 |
|
sr.revf = srcvalue; |
377 |
|
rayvalue(&sr); /* check sample validity */ |
378 |
< |
if (bright(sr.rcol) <= FTINY) |
378 |
> |
if ((d = bright(sr.rcol)) <= FTINY) |
379 |
|
continue; |
380 |
|
nok++; /* got sample; check obstructions */ |
381 |
|
rayclear(&sr); |
382 |
|
sr.revf = raytrace; |
383 |
|
rayvalue(&sr); |
384 |
< |
if (bright(sr.rcol) > FTINY) |
384 |
> |
if ((d1 = bright(sr.rcol)) > FTINY) { |
385 |
> |
if (d - d1 > FTINY) { |
386 |
> |
#ifdef DEBUG |
387 |
> |
fprintf(stderr, "\tpartially shadowed\n"); |
388 |
> |
#endif |
389 |
> |
return(f); /* intervening transmitter */ |
390 |
> |
} |
391 |
|
nhit++; |
392 |
+ |
} |
393 |
|
if (nhit > 0 && nhit < nok) { |
394 |
|
#ifdef DEBUG |
395 |
|
fprintf(stderr, "\tpartially occluded\n"); |