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 10 degrees plus ambacc radians */ |
361 |
> |
const double minangle = 10.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; |
391 |
|
if (delta_r2 >= maxangle*maxangle) |
392 |
|
continue; |
393 |
|
/* |
394 |
+ |
* Modified ray behind test |
395 |
+ |
*/ |
396 |
+ |
VSUB(ck0, av->pos, r->rop); |
397 |
+ |
d = DOT(ck0, uvw[2]); |
398 |
+ |
if (d < -minarad*qambacc-.001) |
399 |
+ |
continue; |
400 |
+ |
d /= av->rad[0]; |
401 |
+ |
delta_t2 = d*d; |
402 |
+ |
if (delta_t2 >= qambacc*qambacc) |
403 |
+ |
continue; |
404 |
+ |
/* |
405 |
|
* Elliptical radii test based on Hessian |
406 |
|
*/ |
407 |
|
decodedir(uvw[0], av->udir); |
408 |
|
VCROSS(uvw[1], uvw[2], uvw[0]); |
396 |
– |
VSUB(ck0, av->pos, r->rop); |
409 |
|
d = DOT(ck0, uvw[0]) / av->rad[0]; |
410 |
< |
delta_t2 = d*d; |
410 |
> |
delta_t2 += d*d; |
411 |
|
d = DOT(ck0, uvw[1]) / av->rad[1]; |
412 |
|
delta_t2 += d*d; |
413 |
|
if (delta_t2 >= qambacc*qambacc) |
402 |
– |
continue; |
403 |
– |
/* |
404 |
– |
* Intersection behind test |
405 |
– |
*/ |
406 |
– |
d = 0.0; |
407 |
– |
for (j = 0; j < 3; j++) |
408 |
– |
d += (r->rop[j] - av->pos[j])*(uvw[2][j] + r->ron[j]); |
409 |
– |
if (d*0.5 < -minarad*qambacc-.001) |
414 |
|
continue; |
415 |
|
/* |
416 |
|
* Extrapolate value and compute final weight (hat function) |