140 |
|
ourspot.siz = PI*maxrad2; |
141 |
|
ourspot.flen = 0.; |
142 |
|
if (source[sn].sflags & SSPOT) { |
143 |
– |
copystruct(&theirspot, source[sn].sl.s); |
143 |
|
multp3(theirspot.aim, source[sn].sl.s->aim, pm); |
144 |
+ |
d = sqrt(dist2(ourspot.aim, theirspot.aim)); |
145 |
+ |
d = sqrt(source[sn].sl.s->siz/PI) + d*source[sn].ss; |
146 |
+ |
theirspot.siz = PI*d*d; |
147 |
+ |
ourspot.flen = theirspot.flen = source[sn].sl.s->flen; |
148 |
|
d = ourspot.siz; |
149 |
|
if (!commonbeam(&ourspot, &theirspot, nsloc)) |
150 |
|
return(-1); /* no overlap */ |
167 |
|
if (source[sn].sflags & SPROX && d > source[sn].sl.prox) |
168 |
|
return(-1); /* too far away */ |
169 |
|
ourspot.flen = 0.; |
170 |
< |
if (d*d > maxrad2) |
171 |
< |
ourspot.siz = 2.*PI*(1. - sqrt(1.-maxrad2/(d*d))); |
170 |
> |
d = (sqrt(maxrad2) + source[sn].ss) / d; |
171 |
> |
if (d < 1.-FTINY) |
172 |
> |
ourspot.siz = 2.*PI*(1. - sqrt(1.-d*d)); |
173 |
|
else |
174 |
|
nsflags &= ~SSPOT; |
175 |
|
if (source[sn].sflags & SSPOT) { |
342 |
|
continue; |
343 |
|
nok++; |
344 |
|
/* check against obstructions */ |
345 |
< |
srcray(&sr, NULL, sn); |
345 |
> |
rayclear(&sr); |
346 |
> |
sr.revf = raytrace; |
347 |
|
rayvalue(&sr); |
348 |
|
if (bright(sr.rcol) > FTINY) |
349 |
|
nhit++; |