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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.99 by greg, Mon Jul 20 15:54:29 2020 UTC vs.
Revision 2.101 by greg, Tue Feb 16 22:06:00 2021 UTC

# Line 420 | Line 420 | rtcompute(                     /* compute and print ray value(s) */
420   )
421   {
422                                          /* set up ray */
423        rayorigin(&thisray, PRIMARY, NULL, NULL);
423          if (imm_irrad) {
424                  VSUM(thisray.rorg, org, dir, 1.1e-4);
425                  thisray.rdir[0] = -dir[0];
426                  thisray.rdir[1] = -dir[1];
427                  thisray.rdir[2] = -dir[2];
428                  thisray.rmax = 0.0;
430                thisray.revf = rayirrad;
429          } else {
430                  VCOPY(thisray.rorg, org);
431                  VCOPY(thisray.rdir, dir);
432                  thisray.rmax = dmax;
435                if (castonly)
436                        thisray.revf = raycast;
433          }
434 +        rayorigin(&thisray, PRIMARY, NULL, NULL);
435 +        if (imm_irrad)
436 +                thisray.revf = rayirrad;
437 +        else if (castonly)
438 +                thisray.revf = raycast;
439          if (ray_pnprocs > 1) {          /* multiprocessing FIFO? */
440                  if (ray_fifo_in(&thisray) < 0)
441                          error(USER, "lost children");
# Line 765 | Line 766 | static RREAL   vdummy[3] = {0.0, 0.0, 0.0};
766  
767  
768   static void
769 < oputp(                          /* print point */
769 > oputp(                          /* print intersection point */
770          RAY  *r
771   )
772   {
773 <        if (r->rot < FHUGE*.99)
773 <                (*putreal)(r->rop, 3);
774 <        else
775 <                (*putreal)(vdummy, 3);
773 >        (*putreal)(r->rop, 3);  /* set to ray origin if distant or no hit */
774   }
775  
776  
# Line 781 | Line 779 | oputN(                         /* print unperturbed normal */
779          RAY  *r
780   )
781   {
782 <        if (r->rot < FHUGE*.99) {
785 <                if (r->rflips & 1) {    /* undo any flippin' flips */
786 <                        FVECT   unrm;
787 <                        unrm[0] = -r->ron[0];
788 <                        unrm[1] = -r->ron[1];
789 <                        unrm[2] = -r->ron[2];
790 <                        (*putreal)(unrm, 3);
791 <                } else
792 <                        (*putreal)(r->ron, 3);
793 <        } else
782 >        if (r->ro == NULL) {    /* zero vector if clipped or no hit */
783                  (*putreal)(vdummy, 3);
784 +                return;
785 +        }
786 +        if (r->rflips & 1) {    /* undo any flippin' flips */
787 +                FVECT   unrm;
788 +                unrm[0] = -r->ron[0];
789 +                unrm[1] = -r->ron[1];
790 +                unrm[2] = -r->ron[2];
791 +                (*putreal)(unrm, 3);
792 +        } else
793 +                (*putreal)(r->ron, 3);
794   }
795  
796  
# Line 802 | Line 801 | oputn(                         /* print perturbed normal */
801   {
802          FVECT  pnorm;
803  
804 <        if (r->rot >= FHUGE*.99) {
804 >        if (r->ro == NULL) {    /* clipped or no hit */
805                  (*putreal)(vdummy, 3);
806                  return;
807          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines