216 |
|
|
217 |
|
|
218 |
|
int |
219 |
< |
srcray( /* send a ray to a source, return domega */ |
220 |
< |
RAY *sr, /* returned source ray */ |
221 |
< |
RAY *r, /* ray which hit object */ |
219 |
> |
srcray( /* aim a ray at a source, return domega */ |
220 |
> |
RAY *sr, /* prepared source ray */ |
221 |
> |
RAY *r, /* originating ray (or NULL) */ |
222 |
|
SRCINDEX *si /* source sample index */ |
223 |
|
) |
224 |
|
{ |
231 |
|
sr->rmax = 0.0; |
232 |
|
|
233 |
|
while ((d = nextssamp(sr, si)) != 0.0) { |
234 |
< |
sr->rsrc = si->sn; /* remember source */ |
234 |
> |
sr->rsrc = si->sn; /* remember source */ |
235 |
|
srcp = source + si->sn; |
236 |
|
if (srcp->sflags & SDISTANT) { |
237 |
|
if (srcp->sflags & SSPOT && spotout(sr, srcp->sl.s)) |
603 |
|
sr.rorg[2] = r->rorg[2] + r->rdir[2]*t; |
604 |
|
|
605 |
|
if (!volumePhotonMapping) { |
606 |
< |
if (srcskip(r->slights[i], r)) |
606 |
> |
sr.parent = r; /* hack for preemptive test */ |
607 |
> |
if (srcskip(r->slights[i], &sr)) |
608 |
|
continue; |
609 |
|
initsrcindex(&si); /* sample ray to this source */ |
610 |
|
si.sn = r->slights[i]; |