From: frohlich Date: Fri, 18 May 2007 07:29:37 +0000 (+0000) Subject: Modified Files: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b4f7ff29efe6f54c0d2486b1628a40494a6d5ac8;p=simgear.git Modified Files: SGVec3.hxx: Fix a problem in perpendicular triangle computation. Solves problem with invalid triangles in ground picking ... --- diff --git a/simgear/math/SGVec3.hxx b/simgear/math/SGVec3.hxx index 3d375c0b..bed95dad 100644 --- a/simgear/math/SGVec3.hxx +++ b/simgear/math/SGVec3.hxx @@ -379,10 +379,10 @@ perpendicular(const SGVec3& v) if (absv2 < absv1 && absv3 < absv1) { T quot = v(1)/v(0); return (1/sqrt(1+quot*quot))*SGVec3(quot, -1, 0); - } else if (absv1 < absv2 && absv3 < absv2) { + } else if (absv3 < absv2) { T quot = v(2)/v(1); return (1/sqrt(1+quot*quot))*SGVec3(0, quot, -1); - } else if (absv1 < absv3 && absv2 < absv3) { + } else if (SGLimits::min() < absv3) { T quot = v(0)/v(2); return (1/sqrt(1+quot*quot))*SGVec3(-1, 0, quot); } else {