213 |
|
) |
214 |
|
{ |
215 |
|
static RNUMBER lastrno = ~0; |
216 |
+ |
|
217 |
+ |
if (rayinitcal[0]) /* initialize on first call */ |
218 |
+ |
initfunc(); |
219 |
|
/* set evaluator context */ |
220 |
|
setcontext(ctx); |
221 |
|
/* check if ray already set */ |
305 |
|
fray->ron[2]*funcxf.xfm[2][n-3] ) |
306 |
|
/ funcxf.sca ); |
307 |
|
|
308 |
< |
if (n <= 8) /* intersection */ |
308 |
> |
if (n <= 8) { /* intersection point */ |
309 |
> |
if (fray->rot >= FHUGE) |
310 |
> |
return(0.0); /* XXX should be runtime error? */ |
311 |
|
|
312 |
|
return( fray->rop[0]*funcxf.xfm[0][n-6] + |
313 |
|
fray->rop[1]*funcxf.xfm[1][n-6] + |
314 |
|
fray->rop[2]*funcxf.xfm[2][n-6] + |
315 |
|
funcxf.xfm[3][n-6] ); |
316 |
+ |
} |
317 |
|
|
318 |
|
if (n == 9) /* total distance */ |
319 |
|
return(raydist(fray,PRIMARY) * funcxf.sca); |