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; |
360 |
|
sr.rorg[i] = oc[i] + offsdir[i] + d*onorm[i]; |
361 |
|
sr.rdir[i] = -onorm[i]; |
362 |
|
} |
363 |
< |
sr.rmax = 0.0; |
364 |
< |
rayorigin(&sr, NULL, PRIMARY, 1.0); |
363 |
> |
rayorigin(&sr, PRIMARY, NULL, NULL); |
364 |
|
} while (!(*ofun[o->otype].funp)(o, &sr)); |
365 |
|
/* check against source */ |
366 |
|
VCOPY(sr.rorg, sr.rop); /* starting from intersection */ |
372 |
|
if (!srcray(&sr, NULL, &si) || sr.rsrc != sn) |
373 |
|
continue; /* can't get there from here */ |
374 |
|
} |
375 |
< |
srcvalue(&sr); /* check sample validity */ |
376 |
< |
if (bright(sr.rcol) <= FTINY) |
375 |
> |
sr.revf = srcvalue; |
376 |
> |
rayvalue(&sr); /* check sample validity */ |
377 |
> |
if ((d = bright(sr.rcol)) <= FTINY) |
378 |
|
continue; |
379 |
|
nok++; /* got sample; check obstructions */ |
380 |
|
rayclear(&sr); |
381 |
+ |
sr.revf = raytrace; |
382 |
|
rayvalue(&sr); |
383 |
< |
if (bright(sr.rcol) > FTINY) |
383 |
> |
if ((d1 = bright(sr.rcol)) > FTINY) { |
384 |
> |
if (d - d1 > FTINY) { |
385 |
> |
#ifdef DEBUG |
386 |
> |
fprintf(stderr, "\tpartially shadowed\n"); |
387 |
> |
#endif |
388 |
> |
return(f); /* intervening transmitter */ |
389 |
> |
} |
390 |
|
nhit++; |
391 |
+ |
} |
392 |
|
if (nhit > 0 && nhit < nok) { |
393 |
|
#ifdef DEBUG |
394 |
|
fprintf(stderr, "\tpartially occluded\n"); |
416 |
|
FILE *fp |
417 |
|
) |
418 |
|
{ |
411 |
– |
register int i; |
412 |
– |
|
419 |
|
fprintf(fp, "%s virtual source %d in %s %s\n", |
420 |
|
source[sn].sflags & SDISTANT ? "distant" : "local", |
421 |
|
sn, ofun[source[sn].so->otype].funame, |