aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D
diff options
context:
space:
mode:
authorhwc4872012-06-29 10:53:03 -0700
committerhwc4872012-06-29 10:53:03 -0700
commit3df60279083f2cda60b3b871037c6d58454de5b2 (patch)
treeea359aa033874d4b907cde6d64d5f10cc0b3de88 /js/helper-classes/3D
parent1c01f1012576dace5f886456f2207e19be366431 (diff)
downloadninja-3df60279083f2cda60b3b871037c6d58454de5b2.tar.gz
Fixes a bug in rectangle containment test.
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-xjs/helper-classes/3D/math-utils.js3
1 files changed, 2 insertions, 1 deletions
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, {
815 { 815 {
816 //var t = vec1.modulus() / vec0.modulus(); 816 //var t = vec1.modulus() / vec0.modulus();
817 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0); 817 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0);
818 if ((this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0)) 818 var dot = VecUtils.vecDot(2, vec0, vec1);
819 if ((this.fpSign(dot) >= 0) && (this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0))
819 return this.ON; 820 return this.ON;
820 else 821 else
821 return this.OUTSIDE; 822 return this.OUTSIDE;