310 |
|
{ |
311 |
|
register struct glare_src *gs; |
312 |
|
FVECT mydir,testdir[7],vhor; |
313 |
< |
double r,omega,p[7],sum; |
313 |
> |
double r,posn,omega,p[7],sum; |
314 |
|
int i,n; |
315 |
|
|
316 |
|
spinvector(mydir, midview.vdir, midview.vup, gd->ang); |
332 |
|
fvsum(testdir[4],testdir[4],midview.vup,-0.866*r); |
333 |
|
for (i = 0; i < 7; i++) { |
334 |
|
normalize(testdir[i]); |
335 |
< |
p[i] = pow(posindex(testdir[i],mydir,midview.vup),-2.0); |
336 |
< |
if (p[i] <= FTINY) p[i] = 0.0; |
335 |
> |
posn = posindex(testdir[i],mydir,midview.vup); |
336 |
> |
if (posn <= FTINY) |
337 |
> |
p[i] = 0.0; |
338 |
> |
else |
339 |
> |
p[i] = 1./(posn*posn); |
340 |
|
} |
341 |
|
r = 1-gs->dom/2./PI; |
342 |
|
omega = gs->dom*p[0]; |