14 #define EPSILON 0.000001
15 #define CROSS(dest,v1,v2) \
16 dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \
17 dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \
18 dest[2]=v1[0]*v2[1]-v1[1]*v2[0];
19 #define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
20 #define SUB(dest,v1,v2) \
21 dest[0]=v1[0]-v2[0]; \
22 dest[1]=v1[1]-v2[1]; \
34 double vert0[3],
double vert1[3],
double vert2[3],
35 double *t,
double *u,
double *
v);
40 double vert0[3],
double vert1[3],
double vert2[3],
41 double *t,
double *u,
double *
v);
47 double vert0[3],
double vert1[3],
double vert2[3],
48 double *t,
double *u,
double *
v);
55 double vert0[3],
double vert1[3],
double vert2[3],
56 double *t,
double *u,
double *
v);
63 double *v0,
double *v1,
double *v2,
Vec3D &I);
int intersect_triangle3(double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v)
int intersect_ray_triangle(const Vec3D &RP0, const Vec3D &dir, Vec3D &TV0, Vec3D &TV1, Vec3D &TV2, Vec3D &I)
int intersect_triangle2(double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
bool rayIntersectsTriangle(double *p, double *d, double *v0, double *v1, double *v2, Vec3D &I)
int intersect_triangle1(double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v)
int intersect_triangle(double orig[3], double dir[3], double vert0[3], double vert1[3], double vert2[3], double *t, double *u, double *v)