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

Comparing ray/src/hd/rhdisp2.c (file contents):
Revision 3.8 by gregl, Tue Dec 2 15:02:37 1997 UTC vs.
Revision 3.9 by gregl, Fri Dec 5 15:50:43 1997 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ SGI";
12   #include "rhdisp.h"
13   #include "rhdriver.h"
14  
15 + #ifndef MAXDIST
16 + #define MAXDIST         13      /* maximum distance outside section */
17 + #endif
18 +
19   extern GCOORD   *getviewcells();
20  
21   static VIEW     dvw;            /* current view corresponding to beam list */
# Line 295 | Line 299 | FVECT  vp;
299                          n++;
300                  }
301          }
302 +                                        /* check for really stupid move */
303 +        if (bestd > MAXDIST) {
304 +                error(WARNING, "move to outer solar system");
305 +                return(0);
306 +        }
307                                          /* warn of dangerous moves */
308          if (n < lastn && bestd >= lastd)
309                  error(WARNING, "moving outside holodeck section");
# Line 442 | Line 451 | beam_sync()            /* synchronize beams on server */
451   }
452  
453  
454 < beam_view(vn)                   /* change beam view */
454 > beam_view(vn)                   /* change beam view (if advisable) */
455   VIEW    *vn;
456   {
457          struct cellact  ca;
# Line 454 | Line 463 | VIEW   *vn;
463                  cbeamop(DR_DELSET, cbeam, ncbeams, NULL, 0, 0);
464                  ncbeams = 0;
465                  copystruct(&dvw, vn);
466 <                return;
466 >                return(1);
467          }
468                                          /* find our new voxels */
469          n = get_voxels(vlnew, vn->vp);
470 +        if (dvw.type && !n) {
471 +                copystruct(vn, &dvw);           /* cancel move */
472 +                return(0);
473 +        }
474                                          /* set the new voxels */
475          comn = set_voxels(vlnew, n);
476          if (!dvw.type)
# Line 480 | Line 493 | VIEW   *vn;
493          xcbeams = 0;                    /* truncate our list */
494   #endif
495          copystruct(&dvw, vn);           /* record new view */
496 +        return(1);
497   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines