41 |
|
if (rdot <= FTINY && rdot >= -FTINY) /* ray parallels plane */ |
42 |
|
t = FHUGE; |
43 |
|
else |
44 |
< |
t = (DOT(r->rorg, f->norm) - f->const) / rdot; |
44 |
> |
t = (DOT(r->rorg, f->norm) - f->offset) / rdot; |
45 |
|
|
46 |
|
if (t <= FTINY || t >= r->rot) /* not good enough */ |
47 |
|
return(0); |
49 |
|
for (i = 0; i < 3; i++) |
50 |
|
pisect[i] = r->rorg[i] + r->rdir[i]*t; |
51 |
|
|
52 |
< |
if (inface(pisect, f)) { /* ray intersects face? */ |
52 |
> |
if (!inface(pisect, f)) /* ray intersects face? */ |
53 |
> |
return(0); |
54 |
|
|
55 |
< |
r->ro = o; |
56 |
< |
r->rot = t; |
57 |
< |
VCOPY(r->rop, pisect); |
58 |
< |
VCOPY(r->ron, f->norm); |
59 |
< |
r->rod = rdot; |
60 |
< |
} |
55 |
> |
r->ro = o; |
56 |
> |
r->rot = t; |
57 |
> |
VCOPY(r->rop, pisect); |
58 |
> |
VCOPY(r->ron, f->norm); |
59 |
> |
r->rod = rdot; |
60 |
> |
r->rofs = 1.0; setident4(r->rofx); |
61 |
> |
r->robs = 1.0; setident4(r->robx); |
62 |
> |
|
63 |
|
return(1); /* hit */ |
64 |
|
} |