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