152 |
|
ambdone(); |
153 |
|
/* init ambient limits */ |
154 |
|
setambres(ambres); |
155 |
< |
setambacc(ambacc); |
155 |
> |
qambacc = sqrt(sqrt(ambacc *= (ambacc > FTINY))); |
156 |
|
if (ambfile == NULL || !ambfile[0]) |
157 |
|
return; |
158 |
|
if (ambacc <= FTINY) { |
357 |
|
FVECT c0, |
358 |
|
double s |
359 |
|
) |
360 |
< |
{ /* initial limit is ambacc radians */ |
361 |
< |
const double maxangle = (ambacc-PI/2.)*pow(r->rweight,0.13) + PI/2.; |
360 |
> |
{ /* initial limit is 5 degrees plus ambacc radians */ |
361 |
> |
const double minangle = 5.0 * PI/180.; |
362 |
> |
const double maxangle = (minangle+ambacc-PI/2.)*pow(r->rweight,0.13) |
363 |
> |
+ PI/2.; |
364 |
|
double wsum = 0.0; |
365 |
|
FVECT ck0; |
366 |
|
int i, j; |
408 |
|
d = 0.0; |
409 |
|
for (j = 0; j < 3; j++) |
410 |
|
d += (r->rop[j] - av->pos[j])*(uvw[2][j] + r->ron[j]); |
411 |
< |
if (d*0.5 < -minarad*ambacc-.001) |
411 |
> |
if (d*0.5 < -minarad*qambacc-.001) |
412 |
|
continue; |
413 |
|
/* |
414 |
|
* Extrapolate value and compute final weight (hat function) |