1 |
< |
/* Copyright (c) 1990 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
140 |
|
} |
141 |
|
if (dstrsrc > FTINY) { |
142 |
|
/* distribute source direction */ |
143 |
< |
dimlist[ndims++] = sn; |
144 |
< |
for (i = 0; i < 3; i++) { |
145 |
< |
dimlist[ndims] = i + 8831; |
146 |
< |
vd[i] = dstrsrc * source[sn].ss * |
147 |
< |
(1.0 - 2.0*urand(urind(ilhash(dimlist,ndims+1),samplendx))); |
148 |
< |
} |
149 |
< |
ndims--; |
143 |
> |
dimlist[ndims] = sn + 8831; |
144 |
> |
multisamp(vd, 3, urand(ilhash(dimlist,ndims+1)+samplendx)); |
145 |
> |
for (i = 0; i < 3; i++) |
146 |
> |
vd[i] = dstrsrc * source[sn].ss * (1. - 2.*vd[i]); |
147 |
|
if (source[sn].sflags & SFLAT) { /* project offset */ |
148 |
|
d = DOT(vd, source[sn].snorm); |
149 |
|
for (i = 0; i < 3; i++) |
161 |
|
if (source[sn].sflags & SDISTANT) { |
162 |
|
if (source[sn].sflags & SSPOT) { /* check location */ |
163 |
|
for (i = 0; i < 3; i++) |
164 |
< |
vd[i] = sr->rorg[i] - source[sn].sl.s->aim[i]; |
164 |
> |
vd[i] = source[sn].sl.s->aim[i] - sr->rorg[i]; |
165 |
|
d = DOT(sr->rdir,vd); |
166 |
+ |
if (d <= FTINY) |
167 |
+ |
return(0.0); |
168 |
|
d = DOT(vd,vd) - d*d; |
169 |
|
if (PI*d > source[sn].sl.s->siz) |
170 |
|
return(0.0); |
244 |
|
int (*f)(); /* direct component coefficient function */ |
245 |
|
char *p; /* data for f */ |
246 |
|
{ |
247 |
+ |
extern int (*trace)(); |
248 |
|
extern double pow(); |
249 |
|
register int sn; |
250 |
|
int nshadcheck, ncnts; |
314 |
|
source[cntord[sn].sno].sflags & SFOLLOW )) { |
315 |
|
/* follow entire path */ |
316 |
|
raycont(&sr); |
317 |
+ |
if (trace != NULL) |
318 |
+ |
(*trace)(&sr); /* trace execution */ |
319 |
|
if (bright(sr.rcol) <= FTINY) |
320 |
|
continue; /* missed! */ |
321 |
|
copycolor(srccnt[cntord[sn].sno].val, sr.rcol); |