287 |
|
getplaneq(onorm, o); |
288 |
|
/* set number of rays to sample */ |
289 |
|
if (source[sn].sflags & SDISTANT) { |
290 |
< |
n = 4.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5; |
290 |
> |
/* 32. == heuristic constant */ |
291 |
> |
n = 32.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5; |
292 |
|
infront = DOT(onorm, source[sn].sloc) > 0.; |
293 |
|
} else { |
294 |
|
for (i = 0; i < 3; i++) |
319 |
|
#endif |
320 |
|
return(f); /* too small a target! */ |
321 |
|
} |
322 |
< |
peano(offsdir, 3, urand(931*i+5827+ssn), .005); |
322 |
> |
multisamp(offsdir, 3, urand(sn*931+5827+ssn)); |
323 |
|
for (i = 0; i < 3; i++) |
324 |
|
offsdir[i] = or*(1. - 2.*offsdir[i]); |
325 |
|
ssn++; |
349 |
|
nok++; |
350 |
|
/* check against obstructions */ |
351 |
|
rayclear(&sr); |
352 |
< |
sr.revf = raytrace; |
352 |
< |
rayvalue(&sr); |
353 |
< |
if (bright(sr.rcol) > FTINY) |
352 |
> |
if (!localhit(&sr, &thescene) || sr.ro == source[sn].so) |
353 |
|
nhit++; |
354 |
|
if (nhit > 0 && nhit < nok) { |
355 |
|
#ifdef DEBUG |