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 2.5 by schorsch, Sat Mar 27 12:41:45 2004 UTC vs.
Revision 2.6 by greg, Tue Jun 14 17:10:06 2005 UTC

# Line 120 | Line 120 | circle2bbox(   /* expand bbox to fit circle */
120          FVECT  bbmax
121   )
122   {
123 <        FVECT  v1, v2;
124 <        register int  i, j;
123 >        double  d, r;
124 >        register int  i;
125  
126          for (i = 0; i < 3; i++) {
127 <                v1[0] = v1[1] = v1[2] = 0;
128 <                v1[i] = 1.0;
129 <                fcross(v2, norm, v1);
130 <                if (normalize(v2) == 0.0)
131 <                        continue;
132 <                for (j = 0; j < 3; j++)
133 <                        v1[j] = cent[j] + rad*v2[j];
134 <                point2bbox(v1, bbmin, bbmax);
135 <                for (j = 0; j < 3; j++)
136 <                        v1[j] = cent[j] - rad*v2[j];
137 <                point2bbox(v1, bbmin, bbmax);
127 >                r = sqrt(1. - norm[i]*norm[i]);
128 >                d = cent[i] + r*rad;
129 >                if (d > bbmax[i])
130 >                        bbmax[i] = d;
131 >                d = cent[i] - r*rad;
132 >                if (d < bbmin[i])
133 >                        bbmin[i] = d;
134          }
135   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines