| 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"; |
| 23 |
|
extern double minweight; /* minimum ray weight */ |
| 24 |
|
extern int do_irrad; /* compute irradiance? */ |
| 25 |
|
|
| 26 |
< |
long nrays = 0L; /* number of rays traced */ |
| 26 |
> |
long raynum = 0L; /* next unique ray number */ |
| 27 |
> |
long nrays = 0L; /* number of calls to rayvalue */ |
| 28 |
|
|
| 29 |
|
static double Lambfa[5] = {PI, PI, PI, 0.0, 0.0}; |
| 30 |
|
OBJREC Lamb = { |
| 62 |
|
r->crtype = ro->crtype | (r->rtype = rt); |
| 63 |
|
VCOPY(r->rorg, ro->rop); |
| 64 |
|
} |
| 65 |
< |
r->rno = nrays; |
| 65 |
> |
r->rno = raynum++; |
| 66 |
|
r->newcset = r->clipset; |
| 67 |
|
r->ro = NULL; |
| 68 |
|
r->rot = FHUGE; |
| 79 |
|
{ |
| 80 |
|
extern int (*trace)(); |
| 81 |
|
|
| 82 |
+ |
nrays++; /* increment trace counter */ |
| 83 |
|
if (localhit(r, &thescene)) |
| 84 |
|
raycont(r); |
| 85 |
|
else if (sourcehit(r)) |
| 123 |
|
/* check for infinite loop */ |
| 124 |
|
if (depth++ >= MAXLOOP) |
| 125 |
|
objerror(r->ro, USER, "possible modifier loop"); |
| 126 |
+ |
r->rt = r->rot; /* set effective ray length */ |
| 127 |
|
for ( ; mod != OVOID; mod = m->omod) { |
| 128 |
|
m = objptr(mod); |
| 129 |
|
/****** unnecessary test since modifier() is always called |
| 139 |
|
raytrans(r); |
| 140 |
|
return; |
| 141 |
|
} |
| 142 |
< |
if (m->otype != MAT_ILLUM) |
| 142 |
> |
if (!islight(m->otype)) |
| 143 |
|
m = &Lamb; |
| 144 |
|
} |
| 145 |
|
(*ofun[m->otype].funp)(m, r); /* execute function */ |
| 315 |
|
double t, dt; |
| 316 |
|
register int i; |
| 317 |
|
|
| 315 |
– |
nrays++; /* increment trace counter */ |
| 316 |
– |
|
| 318 |
|
sflags = 0; |
| 319 |
|
for (i = 0; i < 3; i++) { |
| 320 |
|
curpos[i] = r->rorg[i]; |
| 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 */ |