diff options
author | Valerio Virgillito | 2012-06-22 15:57:43 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-22 15:57:43 -0700 |
commit | f5b8f2cc5f2b7e9cff892d7487ce56019bf66d4c (patch) | |
tree | 22985c8362329c2a3b9aeb2be49c1b84817ce7d6 /js/helper-classes/3D/math-utils.js | |
parent | d3ca3d60b7a0e1455175612824b351bf841447e0 (diff) | |
parent | cd7ba9648312a3f55fae9c33285be1d9540e13f9 (diff) | |
download | ninja-f5b8f2cc5f2b7e9cff892d7487ce56019bf66d4c.tar.gz |
Merge pull request #324 from mqg734/StageGuides
Draw stage left and top references lines. Also fixed IKNinja-1720.
Diffstat (limited to 'js/helper-classes/3D/math-utils.js')
-rwxr-xr-x | js/helper-classes/3D/math-utils.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 35ee8112..44e2499d 100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js | |||
@@ -333,7 +333,7 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { | |||
333 | 333 | ||
334 | //returns the intersection point between the two segments (null if no intersection) | 334 | //returns the intersection point between the two segments (null if no intersection) |
335 | segSegIntersection2D: { | 335 | segSegIntersection2D: { |
336 | value: function (seg0Start, seg0End, seg1Start, seg1End, epsilon) { | 336 | value: function (seg0Start, seg0End, seg1Start, seg1End, epsilon, mustLieInSegements) { |
337 | //check for parallel segments | 337 | //check for parallel segments |
338 | var denom = (seg1End[1] - seg1Start[1]) * (seg0End[0] - seg0Start[0]) - (seg1End[0] - seg1Start[0]) * (seg0End[1] - seg0Start[1]); | 338 | var denom = (seg1End[1] - seg1Start[1]) * (seg0End[0] - seg0Start[0]) - (seg1End[0] - seg1Start[0]) * (seg0End[1] - seg0Start[1]); |
339 | if (Math.abs(denom) <= epsilon) { | 339 | if (Math.abs(denom) <= epsilon) { |
@@ -349,7 +349,7 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { | |||
349 | paramSeg1 /= denom; | 349 | paramSeg1 /= denom; |
350 | 350 | ||
351 | //check whether the parameters are both between 0 and 1 | 351 | //check whether the parameters are both between 0 and 1 |
352 | if (Math.abs(paramSeg0) > 1.0 || Math.abs(paramSeg1) > 1.0) { | 352 | if (mustLieInSegements && (Math.abs(paramSeg0) > 1.0 || Math.abs(paramSeg1) > 1.0)) { |
353 | return null; //no intersection unless the the intersection point lies on both segments | 353 | return null; //no intersection unless the the intersection point lies on both segments |
354 | } | 354 | } |
355 | 355 | ||