From: Mathias Froehlich Date: Wed, 26 Sep 2012 20:45:12 +0000 (+0200) Subject: Fix line segment plane intersect. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fcd17337877e549475710c74a890a63be82ee772;p=simgear.git Fix line segment plane intersect. --- diff --git a/simgear/math/SGIntersect.hxx b/simgear/math/SGIntersect.hxx index 0fd2596b..46bdb427 100644 --- a/simgear/math/SGIntersect.hxx +++ b/simgear/math/SGIntersect.hxx @@ -253,11 +253,11 @@ intersects(SGVec3& dst, const SGLineSegment& lineSegment, const SGPlane // The negative numerator for the \alpha expression T num = plane.getPositiveDist(); - num -= dot(plane.getNormal(), lineSegment.getOrigin()); + num -= dot(plane.getNormal(), lineSegment.getStart()); // If the numerator is zero, we have the lines origin included in the plane if (fabs(num) <= SGLimits::min()) { - dst = lineSegment.getOrigin(); + dst = lineSegment.getStart(); return true; } @@ -279,7 +279,7 @@ intersects(SGVec3& dst, const SGLineSegment& lineSegment, const SGPlane if (1 < alpha) return false; - dst = lineSegment.getOrigin() + alpha*lineSegment.getDirection(); + dst = lineSegment.getStart() + alpha*lineSegment.getDirection(); return true; } // make it symmetric