16 #define CROSS(dest,v1,v2) \
17 dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \
18 dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \
19 dest[2]=v1[0]*v2[1]-v1[1]*v2[0];
20 #define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
21 #define SUB(dest,v1,v2) \
22 dest[0]=v1[0]-v2[0]; \
23 dest[1]=v1[1]-v2[1]; \
35 double vert0[3],
double vert1[3],
double vert2[3],
36 double *t,
double *u,
double *
v);
41 double vert0[3],
double vert1[3],
double vert2[3],
42 double *t,
double *u,
double *
v);
48 double vert0[3],
double vert1[3],
double vert2[3],
49 double *t,
double *u,
double *
v);
56 double vert0[3],
double vert1[3],
double vert2[3],
57 double *t,
double *u,
double *
v);
64 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)