Revision: 45910
http://brlcad.svn.sourceforge.net/brlcad/?rev=45910&view=rev
Author: erikgreenwald
Date: 2011-08-10 20:31:33 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
minor cleanup and reorg
Modified Paths:
--------------
brlcad/trunk/src/libgcv/bottess.c
Modified: brlcad/trunk/src/libgcv/bottess.c
===================================================================
--- brlcad/trunk/src/libgcv/bottess.c 2011-08-10 20:27:26 UTC (rev 45909)
+++ brlcad/trunk/src/libgcv/bottess.c 2011-08-10 20:31:33 UTC (rev 45910)
@@ -45,7 +45,7 @@
#define OPPOSITE 0x08
#define INVERTED 0x10
-#define SOUP_MAGIC 0x534F5550 /* SOUP */
+#define SOUP_MAGIC 0x534F5550 /* SOUP, 32b */
#define SOUP_CKMAG(_ptr) BU_CKMAG(_ptr, SOUP_MAGIC, "soup")
struct face_s {
@@ -120,19 +120,7 @@
/**********************************************************************/
/* stuff from the moller97 paper */
-/* sort so that a<=b */
-#define SORT2(a,b,smallest) \
- if(a>b) \
- { \
- fastf_t _c; \
- _c=a; \
- a=b; \
- b=_c; \
- smallest=1; \
- } \
- else smallest=0;
-
static inline void
fisect2(point_t VTX0,point_t VTX1,point_t VTX2, fastf_t VV0,fastf_t
VV1,fastf_t VV2, fastf_t D0,fastf_t D1,fastf_t D2,fastf_t *isect0,fastf_t
*isect1, point_t isectpoint0,point_t isectpoint1)
{
@@ -273,7 +261,7 @@
{
vect_t D,
isectpointA1={0},isectpointA2={0},isectpointB1={0},isectpointB2={0};
fastf_t
d1,d2,du0,du1,du2,dv0,dv1,dv2,du0du1,du0du2,dv0dv1,dv0dv2,vp0,vp1,vp2,up0,up1,up2,b,c,max,isect1[2]={0,0},isect2[2]={0,0};
- int i,smallest1,smallest2;
+ int i,smallest1=0,smallest2=0;
/* compute plane equation of triangle(lf->vert[0],lf->vert[1],lf->vert[2])
*/
d1=-VDOT(lf->plane,lf->vert[0]);
@@ -333,14 +321,20 @@
/* compute interval for triangle 2 */
compute_intervals_isectline(rf,up0,up1,up2,du0,du1,du2,
du0du1,du0du2,&isect2[0],&isect2[1],isectpointB1,isectpointB2, tol);
+/* sort so that a<=b */
+ smallest1 = smallest2 = 0;
+#define SORT2(a,b,smallest) if(a>b) { fastf_t _c; _c=a; a=b; b=_c; smallest=1;
}
SORT2(isect1[0],isect1[1],smallest1);
SORT2(isect2[0],isect2[1],smallest2);
+#undef SORT2
if(isect1[1]<isect2[0] || isect2[1]<isect1[0])
return 0;
-#if 0
- printf("%f/%f/%f %f/%f/%f | %f/%f/%f %f/%f/%f\n", V3ARGS(isectpointA1),
V3ARGS(isectpointA2), V3ARGS(isectpointB1), V3ARGS(isectpointB2));
+#if 1
+ printf("%d:%d + % 4.2f % 4.2f % 4.2f % 4.2f\t+ % 4.2f/% 4.2f/% 4.2f %
4.2f/% 4.2f/% 4.2f | % 4.2f/% 4.2f/% 4.2f % 4.2f/% 4.2f/% 4.2f\n",
+ smallest1, smallest2, isect1[0], isect1[1], isect2[0],
isect2[1],
+ V3ARGS(isectpointA1), V3ARGS(isectpointA2),
V3ARGS(isectpointB1), V3ARGS(isectpointB2));
#endif
/* at this point, we know that the triangles intersect */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits