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

Comparing ray/src/rt/o_mesh.c (file contents):
Revision 2.5 by greg, Fri Mar 14 21:27:46 2003 UTC vs.
Revision 2.8 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 21 | Line 21 | static const char RCSid[] = "$Id$";
21  
22   #include  "copyright.h"
23  
24 < #include  "ray.h"
24 > #include <string.h>
25  
26 + #include  "ray.h"
27   #include  "mesh.h"
27
28   #include  "tmesh.h"
29  
30  
# Line 39 | Line 39 | struct EdgeCache {
39          OBJREC          *o;     /* mesh object */
40          MESHINST        *mi;    /* current mesh instance */
41          struct EdgeSide {
42 <                int4    v1i, v2i;       /* vertex indices (lowest first) */
42 >                int32   v1i, v2i;       /* vertex indices (lowest first) */
43                  short   signum;         /* signed volume */
44          }               cache[EDGE_CACHE_SIZ];
45   }       edge_cache;
# Line 52 | Line 52 | OBJREC *o;
52                                          /* get mesh instance */
53          edge_cache.mi = getmeshinst(edge_cache.o = o, IO_ALL);
54                                          /* clear edge cache */
55 <        bzero((void *)edge_cache.cache, sizeof(edge_cache.cache));
55 >        memset((void *)edge_cache.cache, '\0', sizeof(edge_cache.cache));
56   }
57  
58  
59   static int
60   signed_volume(r, v1, v2)        /* get signed volume for ray and edge */
61   register RAY    *r;
62 < int4            v1, v2;
62 > int32           v1, v2;
63   {
64          int                             reversed = 0;
65          register struct EdgeSide        *ecp;
66          
67          if (v1 > v2) {
68 <                int4    t = v2; v2 = v1; v1 = t;
68 >                int32   t = v2; v2 = v1; v1 = t;
69                  reversed = 1;
70          }
71          ecp = &edge_cache.cache[((v2<<11 ^ v1) & 0x7fffffff) % EDGE_CACHE_SIZ];
# Line 102 | Line 102 | mesh_hit(oset, r)              /* intersect ray with mesh triangle
102   OBJECT  *oset;
103   RAY     *r;
104   {
105 <        int4            tvi[3];
105 >        int32           tvi[3];
106          int             sv1, sv2, sv3;
107          MESHVERT        tv[3];
108          OBJECT          tmod;
# Line 153 | Line 153 | register RAY   *r;
153          int             flags;
154          MESHVERT        tv[3];
155          OBJECT          tmod;
156 <        FLOAT           wt[3];
156 >        RREAL           wt[3];
157          int             i;
158                                          /* get the mesh instance */
159          prep_edge_cache(o);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines