aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/math-utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/3D/math-utils.js')
-rwxr-xr-xjs/helper-classes/3D/math-utils.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js
index 8a9be4b5..90a85d15 100755
--- a/js/helper-classes/3D/math-utils.js
+++ b/js/helper-classes/3D/math-utils.js
@@ -808,7 +808,7 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, {
808 }, 808 },
809 809
810 boundaryContainsPoint: { 810 boundaryContainsPoint: {
811 value: function( bounds, targetPt, backFacing ) 811 value: function( bounds, targetPt, backFacing, onParams )
812 { 812 {
813 var pt = targetPt.slice(0); 813 var pt = targetPt.slice(0);
814 while (pt.length > 2) pt.pop(); 814 while (pt.length > 2) pt.pop();
@@ -839,8 +839,16 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, {
839 { 839 {
840 //var t = vec1.modulus() / vec0.modulus(); 840 //var t = vec1.modulus() / vec0.modulus();
841 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0); 841 var t = VecUtils.vecMag(2, vec1)/VecUtils.vecMag(2, vec0);
842 if ((this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0)) 842 var dot = VecUtils.vecDot(2, vec0, vec1);
843 if ((this.fpSign(dot) >= 0) && (this.fpSign(t) >= 0) && (this.fpCmp(t,1.0) <= 0))
844 {
845 if (onParams)
846 {
847 onParams[0] = (i+3) % 4;
848 onParams[1] = t;
849 }
843 return this.ON; 850 return this.ON;
851 }
844 else 852 else
845 return this.OUTSIDE; 853 return this.OUTSIDE;
846 } 854 }