From 40f3fc5feae866c99af818a886e8bf9d8cf2b8dd Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 6 Mar 2012 17:23:58 -0800 Subject: merge Valerio's architecture changes into pen tool --- js/lib/geom/sub-path.js | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'js/lib') diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js index ab54d1e9..0a65511b 100755 --- a/js/lib/geom/sub-path.js +++ b/js/lib/geom/sub-path.js @@ -584,6 +584,90 @@ GLSubpath.prototype.pickAnchor = function (pickX, pickY, pickZ, radius) { return selAnchorIndex; }; +GLSubpath.prototype.isWithinBBox =function(x,y,z){ + if (this._BBoxMin[0]>x || this._BBoxMin[1]>y || this._BBoxMin[2]>z){ + return false; + } + if (this._BBoxMax[0]=0 && this._selectedAnchorIndex=0 && selAnchorIndex === -1) { + var distSq = this._Anchors[this._selectedAnchorIndex].getPrevDistanceSq(pickX, pickY, pickZ); + if (distSq < minDistance && distSq < radSq){ + selAnchorIndex = this._selectedAnchorIndex; + minDistance = distSq; + } else { + //check the next for this anchor point + distSq = this._Anchors[this._selectedAnchorIndex].getNextDistanceSq(pickX, pickY, pickZ); + if (distSq