00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ColIntersect_H
00010 #define ColIntersect_H
00011 #if defined(__sgi) || defined(_WIN32)
00012 #pragma once
00013 #endif
00014
00015
00016
00017
00018
00019
00020 #include <math.h>
00021
00022 #include <OpenSG/OSGConfig.h>
00023 #include <OpenSG/OSGBaseTypes.h>
00024 #include <OpenSG/OSGVector.h>
00025 #include <OpenSG/OSGMatrix.h>
00026
00027 #include <col_import_export.h>
00028
00029 namespace col {
00030
00031 extern int vvv;
00032
00033
00034
00035
00041 const unsigned int MaxNVertices = 10;
00042
00043
00044
00045
00046
00047
00048
00049 COL_EXPORTIMPORT
00050 bool intersectPolygons(const osg::Pnt3f *poly1, int plSize1,
00051 const osg::Pnt3f *poly2, int plSize2,
00052 const unsigned int *index1 = NULL,
00053 const unsigned int *index2 = NULL,
00054 const osg::Matrix *cxform = NULL );
00055
00056
00057
00058
00059 COL_EXPORTIMPORT
00060 bool intersectCoplanarTriangles( const osg::Vec3f &normalV,
00061 const osg::Pnt3f &polyVv0,
00062 const osg::Pnt3f &polyVv1,
00063 const osg::Pnt3f &polyVv2,
00064 const osg::Pnt3f &polyUv0,
00065 const osg::Pnt3f &polyUv1,
00066 const osg::Pnt3f &polyUv2 );
00067
00068 COL_EXPORTIMPORT
00069 bool intersectQuadrangles( const osg::Pnt3f &polyVv0,
00070 const osg::Pnt3f &polyVv1,
00071 const osg::Pnt3f &polyVv2,
00072 const osg::Pnt3f &polyVv3,
00073 const osg::Pnt3f &polyUv0,
00074 const osg::Pnt3f &polyUv1,
00075 const osg::Pnt3f &polyUv2,
00076 const osg::Pnt3f &polyUv3,
00077 const osg::Vec3f &normal1V,
00078 const osg::Vec3f &normal2V );
00079
00080 COL_EXPORTIMPORT
00081 bool intersectTriangles( const osg::Pnt3f &polyVv0,
00082 const osg::Pnt3f &polyVv1,
00083 const osg::Pnt3f &polyVv2,
00084 const osg::Pnt3f &polyUv0,
00085 const osg::Pnt3f &polyUv1,
00086 const osg::Pnt3f &polyUv2 );
00087
00088 COL_EXPORTIMPORT
00089 bool intersectTriangles( const osg::Pnt3f &polyVv0,
00090 const osg::Pnt3f &polyVv1,
00091 const osg::Pnt3f &polyVv2,
00092 const osg::Pnt3f &polyUv0,
00093 const osg::Pnt3f &polyUv1,
00094 const osg::Pnt3f &polyUv2,
00095 const osg::Vec3f &n1,
00096 const osg::Vec3f &n2 );
00097
00098 COL_EXPORTIMPORT
00099 bool intersectEdgePolygon( const osg::Pnt3f &v1, const osg::Pnt3f &v2,
00100 const osg::Pnt3f *poly, int c,
00101 const osg::Pnt3f &normalV,
00102 unsigned int x, unsigned int y );
00103
00104 COL_EXPORTIMPORT
00105 bool intersectEdgePolygon( const osg::Pnt3f &v1, const osg::Pnt3f &v2,
00106 const osg::Pnt3f *poly, unsigned int plSize );
00107
00108
00109 COL_EXPORTIMPORT
00110 bool intersectArbPolygons( const osg::Pnt3f *poly1, unsigned int plSize1,
00111 const osg::Pnt3f *poly2, unsigned int plSize2);
00112
00113 COL_EXPORTIMPORT
00114 bool intersectArbPolygons( const osg::Pnt3f *poly1, unsigned int plSize1,
00115 const osg::Pnt3f *poly2, unsigned int plSize2,
00116 const osg::Vec3f &normal1V,
00117 const osg::Vec3f &normal2V );
00118
00119 COL_EXPORTIMPORT
00120 bool intersectCoplanarEdges( const osg::Pnt3f &v0V, const osg::Pnt3f &v1V,
00121 const osg::Pnt3f &u0V, const osg::Pnt3f &u1V,
00122 unsigned int x, unsigned int y);
00123
00124 }
00125
00126 #endif
00127
00128