| 104 |
|
for (i = 0; i < vsmat->nproj; i++) |
| 105 |
|
if ((*vsmat->vproj)(proj, o, &source[sn], i)) |
| 106 |
|
if ((ns = makevsrc(o, sn, proj)) >= 0) { |
| 107 |
+ |
source[ns].sa.sv.pn = i; |
| 108 |
|
#ifdef DEBUG |
| 109 |
|
virtverb(ns, stderr); |
| 110 |
|
#endif |
| 135 |
|
if (source[sn].sflags & SPROX) |
| 136 |
|
return(-1); /* should never get here! */ |
| 137 |
|
multv3(nsloc, source[sn].sloc, pm); |
| 138 |
+ |
normalize(nsloc); |
| 139 |
|
VCOPY(ourspot.aim, ocent); |
| 140 |
|
ourspot.siz = PI*maxrad2; |
| 141 |
|
ourspot.flen = 0.; |
| 171 |
|
if (source[sn].sflags & SSPOT) { |
| 172 |
|
copystruct(&theirspot, source[sn].sl.s); |
| 173 |
|
multv3(theirspot.aim, source[sn].sl.s->aim, pm); |
| 174 |
+ |
normalize(theirspot.aim); |
| 175 |
|
if (nsflags & SSPOT) { |
| 176 |
|
ourspot.flen = theirspot.flen; |
| 177 |
|
d = ourspot.siz; |
| 194 |
|
} |
| 195 |
|
if (source[sn].sflags & SFLAT) { /* behind source? */ |
| 196 |
|
multv3(nsnorm, source[sn].snorm, pm); |
| 197 |
+ |
normalize(nsnorm); |
| 198 |
|
if (!checkspot(&ourspot, nsnorm)) |
| 199 |
|
return(-1); |
| 200 |
|
} |
| 218 |
|
} |
| 219 |
|
if (nsflags & SPROX) |
| 220 |
|
source[i].sl.prox = source[sn].sl.prox; |
| 221 |
< |
source[i].sa.svnext = sn; |
| 221 |
> |
source[i].sa.sv.sn = sn; |
| 222 |
|
source[i].so = op; |
| 223 |
|
return(i); |
| 224 |
|
memerr: |
| 338 |
|
continue; |
| 339 |
|
nok++; |
| 340 |
|
/* check against obstructions */ |
| 341 |
< |
srcray(&sr, NULL, sn); |
| 341 |
> |
rayclear(&sr); |
| 342 |
> |
sr.revf = raytrace; |
| 343 |
|
rayvalue(&sr); |
| 344 |
|
if (bright(sr.rcol) > FTINY) |
| 345 |
|
nhit++; |
| 377 |
|
fprintf(fp, "\tat (%f,%f,%f)\n", |
| 378 |
|
source[sn].sloc[0], source[sn].sloc[1], source[sn].sloc[2]); |
| 379 |
|
fprintf(fp, "\tlinked to source %d (%s)\n", |
| 380 |
< |
source[sn].sa.svnext, source[source[sn].sa.svnext].so->oname); |
| 380 |
> |
source[sn].sa.sv.sn, source[source[sn].sa.sv.sn].so->oname); |
| 381 |
|
if (source[sn].sflags & SFOLLOW) |
| 382 |
|
fprintf(fp, "\talways followed\n"); |
| 383 |
|
else |