aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/math-utils.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-12 15:42:58 -0700
committerValerio Virgillito2012-07-12 15:42:58 -0700
commit2880e1d55a374d48cf39ee074a7a812cd57e1092 (patch)
treeb1f12bce35d5281a3a3d47e3cdcbd75d4c498810 /js/helper-classes/3D/math-utils.js
parent688e22dc367f37d4b8734a37daa3b823ea450295 (diff)
parent325cf1dcbd7fc1e1ec6a9ac4829954f7e0ae2afb (diff)
downloadninja-2880e1d55a374d48cf39ee074a7a812cd57e1092.tar.gz
Merge pull request #389 from ericmueller/GridFixes
Grid fixes
Diffstat (limited to 'js/helper-classes/3D/math-utils.js')
-rwxr-xr-xjs/helper-classes/3D/math-utils.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js
index 977b9fe4..16d168b6 100755
--- a/js/helper-classes/3D/math-utils.js
+++ b/js/helper-classes/3D/math-utils.js
@@ -809,7 +809,7 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, {
809 }, 809 },
810 810
811 boundaryContainsPoint: { 811 boundaryContainsPoint: {
812 value: function( bounds, targetPt, backFacing ) 812 value: function( bounds, targetPt, backFacing, onParams )
813 { 813 {
814 var pt = targetPt.slice(0); 814 var pt = targetPt.slice(0);
815 while (pt.length > 2) pt.pop(); 815 while (pt.length > 2) pt.pop();
@@ -842,7 +842,14 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, {
842 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0); 842 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0);
843 var dot = VecUtils.vecDot(2, vec0, vec1); 843 var dot = VecUtils.vecDot(2, vec0, vec1);
844 if ((this.fpSign(dot) >= 0) && (this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0)) 844 if ((this.fpSign(dot) >= 0) && (this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0))
845 {
846 if (onParams)
847 {
848 onParams[0] = (i+3) % 4;
849 onParams[1] = t;
850 }
845 return this.ON; 851 return this.ON;
852 }
846 else 853 else
847 return this.OUTSIDE; 854 return this.OUTSIDE;
848 } 855 }