--- ray/src/hd/rholo2.c 1997/10/31 10:23:29 3.1 +++ ray/src/hd/rholo2.c 1997/12/01 16:34:36 3.4 @@ -17,14 +17,21 @@ register float *rod; register PACKET *p; { static FVECT ro, rd; - BCOORD gc; - double d; + GCOORD gc[2]; + int ila[2], hsh; + double d, sl[4]; register int i; if (!hdbcoord(gc, hdlist[p->hd], p->bi)) error(CONSISTENCY, "bad beam index in packrays"); + ila[0] = p->hd; ila[1] = p->bi; + hsh = ilhash(ila,2) + p->nc; for (i = 0; i < p->nr; i++) { - *(long *)p->ra[i].r = random()<<16 ^ random(); + multisamp(sl, 4, urand(hsh+i)); + p->ra[i].r[0][0] = sl[0] * 256.; + p->ra[i].r[0][1] = sl[1] * 256.; + p->ra[i].r[1][0] = sl[2] * 256.; + p->ra[i].r[1][1] = sl[3] * 256.; d = hdray(ro, rd, hdlist[p->hd], gc, p->ra[i].r); if (p->offset != NULL) { VSUM(ro, ro, rd, d); /* exterior only */ @@ -53,4 +60,5 @@ register float *rvl; p->ra[i].d = hdcode(hdlist[p->hd], d); rvl += 4; } + p->nc += p->nr; }