--- ray/src/rt/raytrace.c 1991/05/02 11:58:20 1.16 +++ ray/src/rt/raytrace.c 1991/06/14 10:34:26 1.19 @@ -1,4 +1,4 @@ -/* Copyright (c) 1990 Regents of the University of California */ +/* Copyright (c) 1991 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -121,6 +121,7 @@ int mod; /* check for infinite loop */ if (depth++ >= MAXLOOP) objerror(r->ro, USER, "possible modifier loop"); + r->rt = r->rot; /* set effective ray length */ for ( ; mod != OVOID; mod = m->omod) { m = objptr(mod); /****** unnecessary test since modifier() is always called @@ -136,7 +137,7 @@ int mod; raytrans(r); return; } - if (m->otype != MAT_ILLUM) + if (!islight(m->otype)) m = &Lamb; } (*ofun[m->otype].funp)(m, r); /* execute function */ @@ -322,6 +323,8 @@ register CUBE *scene; else if (r->rdir[i] < -FTINY) sflags |= 0x10 << i; } + if (sflags == 0) + error(CONSISTENCY, "zero ray direction in localhit"); t = 0.0; if (!incube(scene, curpos)) { /* find distance to entry */