From 3df60279083f2cda60b3b871037c6d58454de5b2 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 29 Jun 2012 10:53:03 -0700 Subject: Fixes a bug in rectangle containment test. --- js/helper-classes/3D/math-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 44e2499d..409d2750 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js @@ -815,7 +815,8 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { { //var t = vec1.modulus() / vec0.modulus(); var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0); - if ((this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0)) + var dot = VecUtils.vecDot(2, vec0, vec1); + if ((this.fpSign(dot) >= 0) && (this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0)) return this.ON; else return this.OUTSIDE; -- cgit v1.2.3