| 20 |
|
#include "ray.h" |
| 21 |
|
#include "ambient.h" |
| 22 |
|
#include "random.h" |
| 23 |
– |
#include "source.h" |
| 24 |
– |
#include "otypes.h" |
| 25 |
– |
#include "otspecial.h" |
| 23 |
|
|
| 24 |
|
#ifndef OLDAMB |
| 25 |
|
|
| 675 |
|
for (a1 = ang-ang_res; a1 <= ang+ang_res; a1 += ang_step) |
| 676 |
|
flgs |= 1L<<(int)(16/PI*(a1 + 2.*PI*(a1 < 0))); |
| 677 |
|
} |
| 681 |
– |
/* add low-angle incident (< 20deg) */ |
| 682 |
– |
if (fabs(hp->rp->rod) <= 0.342 && hp->rp->parent != NULL && |
| 683 |
– |
(m = findmaterial(hp->rp->parent->ro)) != NULL && |
| 684 |
– |
isopaque(m->otype)) { |
| 685 |
– |
u = -DOT(hp->rp->rdir, uv[0]); |
| 686 |
– |
v = -DOT(hp->rp->rdir, uv[1]); |
| 687 |
– |
if ((r0*r0*u*u + r1*r1*v*v) > hp->rp->rot*hp->rp->rot) { |
| 688 |
– |
ang = atan2a(v, u); |
| 689 |
– |
ang += 2.*PI*(ang < 0); |
| 690 |
– |
ang *= 16/PI; |
| 691 |
– |
if ((ang < .5) | (ang >= 31.5)) |
| 692 |
– |
flgs |= 0x80000001; |
| 693 |
– |
else |
| 694 |
– |
flgs |= 3L<<(int)(ang-.5); |
| 695 |
– |
} |
| 696 |
– |
} |
| 678 |
|
return(flgs); |
| 679 |
|
} |
| 680 |
|
|