16 |
|
|
17 |
|
#ifdef DISPERSE |
18 |
|
#include "source.h" |
19 |
+ |
static disperse(); |
20 |
+ |
static int lambda(); |
21 |
|
#endif |
22 |
|
|
23 |
|
/* |
55 |
|
OBJREC *m; |
56 |
|
register RAY *r; |
57 |
|
{ |
56 |
– |
double sqrt(), pow(); |
58 |
|
double cos1, cos2, nratio; |
59 |
|
COLOR mcolor; |
60 |
|
double mabsorp; |
67 |
|
if (m->oargs.nfargs != (m->otype==MAT_DIELECTRIC ? 5 : 8)) |
68 |
|
objerror(m, USER, "bad arguments"); |
69 |
|
|
69 |
– |
r->rt = r->rot; /* just use ray length */ |
70 |
– |
|
70 |
|
raytexture(r, m->omod); /* get modifiers */ |
71 |
|
|
72 |
|
cos1 = raynormal(dnorm, r); /* cosine of theta1 */ |
128 |
|
if (m->otype != MAT_DIELECTRIC |
129 |
|
|| r->rod > 0.0 |
130 |
|
|| r->crtype & SHADOW |
131 |
< |
|| directinvis |
131 |
> |
|| !directvis |
132 |
|
|| m->oargs.farg[4] == 0.0 |
133 |
|
|| !disperse(m, r, p.rdir, trans)) |
134 |
|
#endif |
137 |
|
multcolor(mcolor, r->pcol); /* modify */ |
138 |
|
scalecolor(p.rcol, trans); |
139 |
|
addcolor(r->rcol, p.rcol); |
140 |
+ |
if (nratio >= 1.0-FTINY && nratio <= 1.0+FTINY) |
141 |
+ |
r->rt = r->rot + p.rt; |
142 |
|
} |
143 |
|
} |
144 |
|
} |
169 |
|
FVECT vt; |
170 |
|
double tr; |
171 |
|
{ |
171 |
– |
double sqrt(); |
172 |
|
RAY sray, *entray; |
173 |
|
FVECT v1, v2, n1, n2; |
174 |
|
FVECT dv, v2Xdv; |