199 |
|
if (source[sn].sflags & SFLAT) { /* behind source? */ |
200 |
|
multv3(nsnorm, source[sn].snorm, pm); |
201 |
|
normalize(nsnorm); |
202 |
< |
if (!checkspot(&ourspot, nsnorm)) |
202 |
> |
if (nsflags & SSPOT && !checkspot(&ourspot, nsnorm)) |
203 |
|
return(-1); |
204 |
|
} |
205 |
|
} |
291 |
|
} else { |
292 |
|
for (i = 0; i < 3; i++) |
293 |
|
offsdir[i] = source[sn].sloc[i] - oc[i]; |
294 |
< |
n = or2/DOT(offsdir,offsdir)*vspretest + .5; |
294 |
> |
d = DOT(offsdir,offsdir); |
295 |
> |
if (d <= FTINY) |
296 |
> |
n = 2.*PI * vspretest + .5; |
297 |
> |
else |
298 |
> |
n = 2.*PI * (1.-sqrt(1./(1.+or2/d)))*vspretest + .5; |
299 |
|
infront = DOT(onorm, offsdir) > 0.; |
300 |
|
} |
301 |
|
if (n < MINSAMPLES) n = MINSAMPLES; |