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.3 by greg, Wed Mar 12 04:59:05 2003 UTC vs.
Revision 2.4 by greg, Wed Mar 12 17:26:58 2003 UTC

# Line 71 | Line 71 | int4           v1, v2;
71          ecp = &edge_cache.cache[((v2<<11 ^ v1) & 0x7fffffff) % EDGE_CACHE_SIZ];
72          if (ecp->v1i != v1 || ecp->v2i != v2) {
73                  MESHVERT        tv1, tv2;       /* compute signed volume */
74 +                FVECT           v2d;
75                  double          vol;
76                  if (!getmeshvert(&tv1, edge_cache.mi->msh, v1, MT_V) ||
77                              !getmeshvert(&tv2, edge_cache.mi->msh, v2, MT_V))
78                          objerror(edge_cache.o, INTERNAL,
79                                  "missing mesh vertex in signed_volume");
80 +                VSUB(v2d, tv2.v, r->rorg);
81                  vol = (tv1.v[0] - r->rorg[0]) *
82 <                                ( (tv2.v[1] - r->rorg[1])*r->rdir[2] -
81 <                                  (tv2.v[2] - r->rorg[2])*r->rdir[1] );
82 >                                (v2d[1]*r->rdir[2] - v2d[2]*r->rdir[1]);
83                  vol += (tv1.v[1] - r->rorg[1]) *
84 <                                ( (tv2.v[2] - r->rorg[2])*r->rdir[0] -
84 <                                  (tv2.v[0] - r->rorg[0])*r->rdir[2] );
84 >                                (v2d[2]*r->rdir[0] - v2d[0]*r->rdir[2]);
85                  vol += (tv1.v[2] - r->rorg[2]) *
86 <                                ( (tv2.v[0] - r->rorg[0])*r->rdir[1] -
87 <                                  (tv2.v[1] - r->rorg[1])*r->rdir[0] );
86 >                                (v2d[0]*r->rdir[1] - v2d[1]*r->rdir[0]);
87                  if (vol > .0)
88                          ecp->signum = 1;
89                  else if (vol < .0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines