59 |
|
scompile("Dx=$1;Dy=$2;Dz=$3;", NULL, 0); |
60 |
|
scompile("Nx=$4;Ny=$5;Nz=$6;", NULL, 0); |
61 |
|
scompile("Px=$7;Py=$8;Pz=$9;", NULL, 0); |
62 |
< |
scompile("T=$10;Rdot=$11;", NULL, 0); |
62 |
> |
scompile("T=$10;Ts=$25;Rdot=$11;", NULL, 0); |
63 |
|
scompile("S=$12;Tx=$13;Ty=$14;Tz=$15;", NULL, 0); |
64 |
|
scompile("Ix=$16;Iy=$17;Iz=$18;", NULL, 0); |
65 |
|
scompile("Jx=$19;Jy=$20;Jz=$21;", NULL, 0); |
80 |
|
if (i == 1 && arg[ff][0] == '.') |
81 |
|
setcontext(f->ctx = ""); /* "." means no file */ |
82 |
|
else { |
83 |
< |
strcpy(sbuf,m->oargs.sarg[ff]); /* file name is context */ |
83 |
> |
strcpy(sbuf,arg[ff]); /* file name is context */ |
84 |
|
if (i > LCALSUF && !strcmp(sbuf+i-LCALSUF, CALSUF)) |
85 |
|
sbuf[i-LCALSUF] = '\0'; /* remove suffix */ |
86 |
|
setcontext(f->ctx = savestr(sbuf)); |
87 |
|
if (!vardefined(REFVNAME)) { /* file loaded? */ |
88 |
< |
loadfunc(m->oargs.sarg[ff]); |
88 |
> |
loadfunc(arg[ff]); |
89 |
|
varset(REFVNAME, '=', 1.0); |
90 |
|
} else /* reference_count++ */ |
91 |
|
varset(REFVNAME, '=', varvalue(REFVNAME)+1.0); |
273 |
|
fray->rop[2]*funcxf.xfm[2][n-6] + |
274 |
|
funcxf.xfm[3][n-6] ); |
275 |
|
|
276 |
< |
if (n == 9) { /* distance */ |
277 |
< |
|
276 |
> |
if (n == 9) { /* total distance */ |
277 |
|
sum = fray->rot; |
278 |
|
for (r = fray->parent; r != NULL; r = r->parent) |
279 |
|
sum += r->rot; |
280 |
|
return(sum * funcxf.sca); |
281 |
|
|
282 |
|
} |
283 |
+ |
|
284 |
|
if (n == 10) /* dot product (range [-1,1]) */ |
285 |
|
return( fray->rod <= -1.0 ? -1.0 : |
286 |
|
fray->rod >= 1.0 ? 1.0 : |
300 |
|
|
301 |
|
if (n < 24) /* k unit vector */ |
302 |
|
return(funcxf.xfm[2][n-21] / funcxf.sca); |
303 |
+ |
|
304 |
+ |
if (n == 24) { /* single ray (shadow) distance */ |
305 |
+ |
sum = fray->rot; |
306 |
+ |
for (r = fray->parent; r != NULL && r->crtype&SHADOW; |
307 |
+ |
r = r->parent) |
308 |
+ |
sum += r->rot; |
309 |
+ |
return(sum * funcxf.sca); |
310 |
+ |
} |
311 |
|
badchan: |
312 |
|
error(USER, "illegal channel number"); |
313 |
|
} |