aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/math-utils.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-12 15:43:33 -0700
committerValerio Virgillito2012-07-12 15:43:33 -0700
commitc250404e7e1b8015ccc4967a102e2d3873f2d83a (patch)
treefccede2bcb093658b0da15368bfc66bceea7a7d8 /js/helper-classes/3D/math-utils.js
parent393b86e1c94147b55f761631beef844f7cdc55b7 (diff)
parent2880e1d55a374d48cf39ee074a7a812cd57e1092 (diff)
downloadninja-c250404e7e1b8015ccc4967a102e2d3873f2d83a.tar.gz
Merge branch 'refs/heads/master' into v0.7.1
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 }