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

Comparing ray/src/rt/m_clip.c (file contents):
Revision 2.4 by gwlarson, Mon Aug 10 18:38:56 1998 UTC vs.
Revision 2.10 by greg, Wed Jul 25 04:12:36 2007 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  m_clip.c - routine for clipped (cut) objects.
9 *
10 *     3/17/86
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  "ray.h"
11 + #include  "rtotypes.h"
12  
13   /*
14   *  Clipping objects permit holes and sections to be taken out
# Line 21 | Line 19 | static char SCCSid[] = "$SunId$ SGI";
19   */
20  
21  
22 < m_clip(m, r)                    /* clip objects from ray */
23 < register OBJREC  *m;
24 < register RAY  *r;
22 > extern int
23 > m_clip(                 /* clip objects from ray */
24 >        register OBJREC  *m,
25 >        register RAY  *r
26 > )
27   {
28          OBJECT  cset[MAXSET+1], *modset;
29          OBJECT  obj, mod;
# Line 55 | Line 55 | register RAY  *r;
55                  }
56                  m->os = (char *)modset;
57          }
58 +        if (r == NULL)
59 +                return(0);                      /* just initializing */
60          if (r->clipset != NULL)
61                  setcopy(cset, r->clipset);
62          else
# Line 78 | Line 80 | register RAY  *r;
80          r->newcset = cset;
81          if (strcmp(m->oargs.sarg[0], VOIDID)) {
82                  int  inside = 0;
83 <                register RAY  *rp;
83 >                register const RAY  *rp;
84                                          /* check for penetration */
85                  for (rp = r; rp->parent != NULL; rp = rp->parent)
86                          if (!(rp->rtype & RAYREFL) && rp->parent->ro != NULL
87 <                                        && inset(modset, rp->parent->ro->omod))
87 >                                        && inset(modset, rp->parent->ro->omod)) {
88                                  if (rp->parent->rod > 0.0)
89                                          inside++;
90                                  else
91                                          inside--;
92 +                        }
93                  if (inside > 0) {       /* we just hit the object */
94                          flipsurface(r);
95                          return(rayshade(r, lastmod(obj, m->oargs.sarg[0])));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines