X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2FSGIntersect.hxx;h=46bdb427d0e027c388be42a3997858eeed1ec4ac;hb=3bcd0bafd5fba1eebadfd1cb8a7294d665cf1932;hp=24741f6409bd78dcfeb603525aab6cbd0a474592;hpb=2cc2a857a2cc2daff30601e0f8f697c768dd5b30;p=simgear.git diff --git a/simgear/math/SGIntersect.hxx b/simgear/math/SGIntersect.hxx index 24741f64..46bdb427 100644 --- a/simgear/math/SGIntersect.hxx +++ b/simgear/math/SGIntersect.hxx @@ -18,6 +18,8 @@ #ifndef SGIntersect_HXX #define SGIntersect_HXX +#include + template inline bool intersects(const SGSphere& s1, const SGSphere& s2) @@ -251,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; } @@ -277,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