| 1 | 
< | 
/* Copyright (c) 1990 Regents of the University of California */ | 
| 1 | 
> | 
/* Copyright (c) 1991 Regents of the University of California */ | 
| 2 | 
  | 
 | 
| 3 | 
  | 
#ifndef lint | 
| 4 | 
  | 
static char SCCSid[] = "$SunId$ LBL"; | 
| 118 | 
  | 
{ | 
| 119 | 
  | 
        static int  depth = 0; | 
| 120 | 
  | 
        register OBJREC  *m; | 
| 121 | 
– | 
                                        /* check for irradiance calc. */ | 
| 122 | 
– | 
        if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS))) { | 
| 123 | 
– | 
                if (irr_ignore(objptr(mod)->otype)) | 
| 124 | 
– | 
                        raytrans(r); | 
| 125 | 
– | 
                else | 
| 126 | 
– | 
                        (*ofun[Lamb.otype].funp)(&Lamb, r); | 
| 127 | 
– | 
                return; | 
| 128 | 
– | 
        } | 
| 121 | 
  | 
                                        /* check for infinite loop */ | 
| 122 | 
  | 
        if (depth++ >= MAXLOOP) | 
| 123 | 
  | 
                objerror(r->ro, USER, "possible modifier loop"); | 
| 124 | 
+ | 
        r->rt = r->rot;                 /* set effective ray length */ | 
| 125 | 
  | 
        for ( ; mod != OVOID; mod = m->omod) { | 
| 126 | 
  | 
                m = objptr(mod); | 
| 127 | 
  | 
                /****** unnecessary test since modifier() is always called | 
| 130 | 
  | 
                        error(USER, errmsg); | 
| 131 | 
  | 
                } | 
| 132 | 
  | 
                ******/ | 
| 133 | 
+ | 
                                        /* hack for irradiance calculation */ | 
| 134 | 
+ | 
                if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS))) { | 
| 135 | 
+ | 
                        if (irr_ignore(m->otype)) { | 
| 136 | 
+ | 
                                depth--; | 
| 137 | 
+ | 
                                raytrans(r); | 
| 138 | 
+ | 
                                return; | 
| 139 | 
+ | 
                        } | 
| 140 | 
+ | 
                        if (!islight(m->otype)) | 
| 141 | 
+ | 
                                m = &Lamb; | 
| 142 | 
+ | 
                } | 
| 143 | 
  | 
                (*ofun[m->otype].funp)(m, r);   /* execute function */ | 
| 144 | 
  | 
                m->lastrno = r->rno; | 
| 145 | 
  | 
                if (ismaterial(m->otype)) {     /* materials call raytexture */ | 
| 323 | 
  | 
                else if (r->rdir[i] < -FTINY) | 
| 324 | 
  | 
                        sflags |= 0x10 << i; | 
| 325 | 
  | 
        } | 
| 326 | 
+ | 
        if (sflags == 0) | 
| 327 | 
+ | 
                error(CONSISTENCY, "zero ray direction in localhit"); | 
| 328 | 
  | 
        t = 0.0; | 
| 329 | 
  | 
        if (!incube(scene, curpos)) { | 
| 330 | 
  | 
                                        /* find distance to entry */ |