59 |
|
if (source == NULL) |
60 |
|
return(-1); |
61 |
|
source[nsources].sflags = 0; |
62 |
< |
source[nsources].nhits = 0; |
63 |
< |
source[nsources].ntests = 1; /* initial hit probability = 0 */ |
62 |
> |
source[nsources].nhits = 1; |
63 |
> |
source[nsources].ntests = 2; /* initial hit probability = 50% */ |
64 |
|
#if SHADCACHE |
65 |
|
source[nsources].obscache = NULL; |
66 |
|
#endif |
109 |
|
src->sloc[j] /= (double)f->nv; |
110 |
|
} |
111 |
|
if (!inface(src->sloc, f)) |
112 |
< |
objerror(so, USER, "cannot hit center"); |
112 |
> |
objerror(so, USER, "cannot hit center for source"); |
113 |
|
src->sflags |= SFLAT; |
114 |
|
VCOPY(src->snorm, f->norm); |
115 |
|
src->ss2 = f->area; |
195 |
|
co = getcone(so, 0); |
196 |
|
VCOPY(src->sloc, CO_P0(co)); |
197 |
|
if (CO_R0(co) > 0.0) |
198 |
< |
objerror(so, USER, "cannot hit center"); |
198 |
> |
objerror(so, USER, "cannot hit center for source"); |
199 |
|
src->sflags |= SFLAT; |
200 |
|
VCOPY(src->snorm, co->ad); |
201 |
|
src->srad = CO_R1(co); |