24 |
|
register INSTANCE *in; |
25 |
|
register int i; |
26 |
|
/* get the octree */ |
27 |
< |
in = getinstance(o, GET_ALL); |
27 |
> |
in = getinstance(o, IO_ALL); |
28 |
|
/* copy old ray */ |
29 |
< |
bcopy(r, &rcont, sizeof(RAY)); |
29 |
> |
copystruct(&rcont, r); |
30 |
|
/* transform it */ |
31 |
|
rcont.rno = nrays; |
32 |
|
rcont.ro = NULL; |
33 |
|
rcont.rot = FHUGE; |
34 |
– |
rcont.rno = nrays; |
34 |
|
multp3(rcont.rorg, r->rorg, in->b.xfm); |
35 |
|
multv3(rcont.rdir, r->rdir, in->b.xfm); |
36 |
|
for (i = 0; i < 3; i++) |
40 |
|
return(0); /* missed */ |
41 |
|
if (rcont.rot * in->f.sca >= r->rot) |
42 |
|
return(0); /* not close enough */ |
43 |
< |
/* if we have modifier, use it */ |
44 |
< |
if (o->omod != OVOID) |
43 |
> |
|
44 |
> |
if (o->omod != OVOID) { /* if we have modifier, use it */ |
45 |
|
r->ro = o; |
46 |
< |
else { /* else use theirs */ |
46 |
> |
r->rofs = 1.0; setident4(r->rofx); |
47 |
> |
r->robs = 1.0; setident4(r->robx); |
48 |
> |
} else { /* else use theirs */ |
49 |
|
r->ro = rcont.ro; |
50 |
< |
multmat4(r->rofx, in->f.xfm, rcont.rofx); |
51 |
< |
r->rofs = in->f.sca * rcont.rofs; |
50 |
> |
multmat4(r->rofx, rcont.rofx, in->f.xfm); |
51 |
> |
r->rofs = rcont.rofs * in->f.sca; |
52 |
|
multmat4(r->robx, in->b.xfm, rcont.robx); |
53 |
|
r->robs = in->b.sca * rcont.robs; |
54 |
|
} |