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.100 by greg, Wed Jan 27 00:00:05 2021 UTC

# Line 765 | Line 765 | static RREAL   vdummy[3] = {0.0, 0.0, 0.0};
765  
766  
767   static void
768 < oputp(                          /* print point */
768 > oputp(                          /* print intersection point */
769          RAY  *r
770   )
771   {
772 <        if (r->rot < FHUGE*.99)
773 <                (*putreal)(r->rop, 3);
774 <        else
775 <                (*putreal)(vdummy, 3);
772 >        (*putreal)(r->rop, 3);  /* set to ray origin if distant or no hit */
773   }
774  
775  
# Line 781 | Line 778 | oputN(                         /* print unperturbed normal */
778          RAY  *r
779   )
780   {
781 <        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
781 >        if (r->ro == NULL) {    /* zero vector if clipped or no hit */
782                  (*putreal)(vdummy, 3);
783 +                return;
784 +        }
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   }
794  
795  
# Line 802 | Line 800 | oputn(                         /* print perturbed normal */
800   {
801          FVECT  pnorm;
802  
803 <        if (r->rot >= FHUGE*.99) {
803 >        if (r->ro == NULL) {    /* clipped or no hit */
804                  (*putreal)(vdummy, 3);
805                  return;
806          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines