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

Comparing ray/src/rt/rv3.c (file contents):
Revision 2.11 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.14 by greg, Tue Jan 18 00:33:16 2005 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 < #include  "ray.h"
12 > #include <string.h>
13  
14 + #include  "ray.h"
15   #include  "rpaint.h"
15
16   #include  "random.h"
17  
18   #ifndef WFLUSH
# Line 125 | Line 125 | double  *mp;
125          } else if (direc)
126                          for (i = 0; i < 3; i++)
127                                  vec[i] -= ourview.vp[i];
128 +        if (normalize(vec) == 0.0)
129 +                return(-1);
130          return(0);
131   }
132  
# Line 371 | Line 373 | register VIEW  *vp;
373          if ((err = setview(vp)) != NULL) {
374                  sprintf(errmsg, "view not set - %s", err);
375                  error(COMMAND, errmsg);
376 <        } else if (bcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) {
377 <                copystruct(&oldview, &ourview);
378 <                copystruct(&ourview, vp);
376 >        } else if (memcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) {
377 >                oldview = ourview;
378 >                ourview = *vp;
379                  newimage();
380          }
381   }
# Line 386 | Line 388 | FVECT  vc;
388   {
389          double  d;
390          FVECT  v1;
391 <        VIEW  nv;
391 >        VIEW  nv = ourview;
392          register int  i;
393  
392        VCOPY(nv.vup, ourview.vup);
393        nv.hoff = ourview.hoff; nv.voff = ourview.voff;
394          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
395          if (elev != 0.0) {
396                  fcross(v1, ourview.vup, nv.vdir);
# Line 403 | Line 403 | FVECT  vc;
403                  d = 0.0;                        /* don't move closer */
404                  for (i = 0; i < 3; i++)
405                          d += (vc[i] - ourview.vp[i])*ourview.vdir[i];
406                nv.vfore = ourview.vfore;
407                nv.vaft = ourview.vaft;
406          } else {
409                nv.horiz = ourview.horiz;
410                nv.vert = ourview.vert;
407                  d = sqrt(dist2(ourview.vp, vc)) / mag;
408                  if ((nv.vfore = ourview.vfore) > FTINY) {
409                          nv.vfore += d - d*mag;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines