ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/bsdfrep.c
(Generate patch)

Comparing ray/src/cv/bsdfrep.c (file contents):
Revision 2.8 by greg, Fri Nov 9 02:16:29 2012 UTC vs.
Revision 2.10 by greg, Sun Nov 18 03:56:39 2012 UTC

# Line 189 | Line 189 | rotate_rbf(RBFNODE *rbf, const FVECT invec)
189          int                     pos[2];
190          int                     n;
191  
192 <        for (n = rbf->nrbf; n-- > 0; ) {
192 >        for (n = ((-.01 > phi) | (phi > .01))*rbf->nrbf; n-- > 0; ) {
193                  ovec_from_pos(outvec, rbf->rbfa[n].gx, rbf->rbfa[n].gy);
194                  spinvector(outvec, outvec, vnorm, phi);
195                  pos_from_vec(pos, outvec);
# Line 485 | Line 485 | load_bsdf_rep(FILE *ifp)
485                  rbfh.invec[0] = getflt(ifp);
486                  rbfh.invec[1] = getflt(ifp);
487                  rbfh.invec[2] = getflt(ifp);
488 +                if (normalize(rbfh.invec) == 0) {
489 +                        fprintf(stderr, "%s: zero incident vector\n", progname);
490 +                        return(0);
491 +                }
492                  rbfh.vtotal = getflt(ifp);
493                  rbfh.nrbf = getint(4, ifp);
494                  newrbf = (RBFNODE *)malloc(sizeof(RBFNODE) +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines