| 64 |
|
int ii, jj; |
| 65 |
|
/* min. spacing = 1/4th division */ |
| 66 |
|
cos_thresh = (PI/4.)/(double)hp->ns; |
| 67 |
+ |
if (cos_thresh > 7.*PI/180.) /* 7 degrees is enough in any case */ |
| 68 |
+ |
cos_thresh = 7.*PI/180.; |
| 69 |
|
cos_thresh = 1. - .5*cos_thresh*cos_thresh; |
| 70 |
|
/* check existing neighbors */ |
| 71 |
|
for (ii = i-1; ii <= i+1; ii++) { |
| 129 |
|
spt[1]*hp->uy[ii] + |
| 130 |
|
zd*hp->onrm[ii]; |
| 131 |
|
checknorm(ar.rdir); |
| 132 |
< |
/* avoid coincident samples */ |
| 133 |
< |
if (!n && hp->ns >= 4 && ambcollision(hp, i, j, ar.rdir)) { |
| 132 |
> |
/* avoid coincident samples? */ |
| 133 |
> |
if (!n & (ambacc > FTINY) & (hp->ns >= 4) && |
| 134 |
> |
ambcollision(hp, i, j, ar.rdir)) { |
| 135 |
|
ss[0] = frandom(); ss[1] = frandom(); |
| 136 |
|
goto resample; /* reject this sample */ |
| 137 |
|
} |