aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE
diff options
context:
space:
mode:
authorPushkar Joshi2012-01-31 12:05:15 -0800
committerPushkar Joshi2012-01-31 12:05:15 -0800
commitf0e3fa691b3c042c9fc49a7a0cde8ddf8100c195 (patch)
tree182d61721570e49a304894d54f0f451077770ee9 /js/helper-classes/RDGE
parent972e0ce4df7b332601ad006ca8b7dd9e189a59ef (diff)
downloadninja-f0e3fa691b3c042c9fc49a7a0cde8ddf8100c195.tar.gz
display the anchor point to be selected on mouse hover
Diffstat (limited to 'js/helper-classes/RDGE')
-rw-r--r--js/helper-classes/RDGE/GLSubpath.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/helper-classes/RDGE/GLSubpath.js b/js/helper-classes/RDGE/GLSubpath.js
index 78315e40..2e4c1631 100644
--- a/js/helper-classes/RDGE/GLSubpath.js
+++ b/js/helper-classes/RDGE/GLSubpath.js
@@ -363,6 +363,23 @@ function GLSubpath() {
363 return true; 363 return true;
364 } 364 }
365 365
366 this.pickAnchor = function (pickX, pickY, pickZ, radius) {
367 var numAnchors = this._Anchors.length;
368 var selAnchorIndex = -1;
369 var retCode = this.SEL_NONE;
370 var radSq = radius * radius;
371 var minDistance = Infinity;
372 for (var i = 0; i < numAnchors; i++) {
373 var distSq = this._Anchors[i].getDistanceSq(pickX, pickY, pickZ);
374 //check the anchor point
375 if (distSq < minDistance && distSq < radSq) {
376 selAnchorIndex = i;
377 minDistance = distSq;
378 }
379 }//for every anchor i
380 return selAnchorIndex;
381 }
382
366 //pick the path point closest to the specified location, return null if some anchor point (or its handles) is within radius, else return the parameter distance 383 //pick the path point closest to the specified location, return null if some anchor point (or its handles) is within radius, else return the parameter distance
367 this.pickPath = function (pickX, pickY, pickZ, radius) { 384 this.pickPath = function (pickX, pickY, pickZ, radius) {
368 var numAnchors = this._Anchors.length; 385 var numAnchors = this._Anchors.length;