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

Comparing ray/src/ot/bbox.c (file contents):
Revision 1.3 by greg, Tue Oct 24 13:59:20 1989 UTC vs.
Revision 2.4 by greg, Tue Mar 11 17:08:55 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1987 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  bbox.c - routines for bounding box computation.
9 *
10 *      8/4/87
6   */
7  
8 + #include  "copyright.h"
9 +
10   #include  "standard.h"
11  
12   #include  "object.h"
13  
14 + #include  "octree.h"
15 +
16   #include  "otypes.h"
17  
18   #include  "face.h"
# Line 22 | Line 21 | static char SCCSid[] = "$SunId$ LBL";
21  
22   #include  "instance.h"
23  
24 + #include  "mesh.h"
25  
26 +
27   add2bbox(o, bbmin, bbmax)               /* expand bounding box to fit object */
28   register OBJREC  *o;
29   FVECT  bbmin, bbmax;
# Line 30 | Line 31 | FVECT  bbmin, bbmax;
31          CONE  *co;
32          FACE  *fo;
33          INSTANCE  *io;
34 +        MESHINST  *mi;
35          FVECT  v;
36          register int  i, j;
37  
# Line 70 | Line 72 | FVECT  bbmin, bbmax;
72                                  if (j & 1<<i)
73                                          v[i] += io->obj->scube.cusize;
74                          }
75 <                        multp3(v, v, io->f.xfm);
75 >                        multp3(v, v, io->x.f.xfm);
76 >                        point2bbox(v, bbmin, bbmax);
77 >                }
78 >                break;
79 >        case OBJ_MESH:
80 >                mi = getmeshinst(o, IO_BOUNDS);
81 >                for (j = 0; j < 8; j++) {
82 >                        for (i = 0; i < 3; i++) {
83 >                                v[i] = mi->msh->mcube.cuorg[i];
84 >                                if (j & 1<<i)
85 >                                        v[i] += mi->msh->mcube.cusize;
86 >                        }
87 >                        multp3(v, v, mi->x.f.xfm);
88                          point2bbox(v, bbmin, bbmax);
89                  }
90                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines