correcter .dir to .Direction and .ori in .Origin()

This commit is contained in:
Nico Pietroni 2004-08-09 09:48:43 +00:00
parent 7ed650db98
commit d18f2f9f39
1 changed files with 6 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.9 2004/08/04 20:55:02 pietroni
added rey triangle intersections funtions
Revision 1.8 2004/07/11 22:08:04 cignoni Revision 1.8 2004/07/11 22:08:04 cignoni
Added a cast to remove a warning Added a cast to remove a warning
@ -210,7 +213,7 @@ bool Intersection( const Line3<T> & ray, const Point3<T> & vert0,
Point3<T> edge2 = vert2 - vert0; Point3<T> edge2 = vert2 - vert0;
// determinant // determinant
Point3<T> pvec = ray.dire ^ edge2; Point3<T> pvec = ray.Direction() ^ edge2;
T det = edge1*pvec; T det = edge1*pvec;
@ -218,7 +221,7 @@ bool Intersection( const Line3<T> & ray, const Point3<T> & vert0,
if (fabs(det) < EPSILON) return false; if (fabs(det) < EPSILON) return false;
// calculate distance from vert0 to ray origin // calculate distance from vert0 to ray origin
Point3<T> tvec = ray.orig - vert0; Point3<T> tvec = ray.Origin()- vert0;
// calculate A parameter and test bounds // calculate A parameter and test bounds
a = tvec * pvec; a = tvec * pvec;
@ -228,7 +231,7 @@ bool Intersection( const Line3<T> & ray, const Point3<T> & vert0,
Point3<T> qvec = tvec ^ edge1; Point3<T> qvec = tvec ^ edge1;
// calculate B parameter and test bounds // calculate B parameter and test bounds
b = ray.dire * qvec ; b = ray.Direction() * qvec ;
if (b < -EPSILON2*det || b + a > det+det*EPSILON2) return false; if (b < -EPSILON2*det || b + a > det+det*EPSILON2) return false;
// calculate t, scale parameters, ray intersects triangle // calculate t, scale parameters, ray intersects triangle