Skip to content
Snippets Groups Projects
Commit a13f3b1f authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

update gik scale

parent 62f1b049
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ Lattice = Backbone.Model.extend({
//bind events
this.listenTo(this, "change:scale", this._scaleDidChange);
this.listenTo(this, "change:gikLength", this._gikLengthDidChange);
this.listenTo(options.appState, "change:cellMode", this._updateForMode);
this.listenTo(this, "change:partType", this._updatePartType);
this.listenTo(this, "change:cellType change:connectionType", this._updateLatticeType);
......@@ -369,6 +370,10 @@ Lattice = Backbone.Model.extend({
dmaGlobals.three.render();
},
_gikLengthDidChange: function(){
if (this.get("highlighter").updateGikLength) this.get("highlighter").updateGikLength(this.get("scale"));
},
previewScaleChange: function(scale){
this.get("basePlane").updateScale(scale);
},
......
......@@ -56,6 +56,7 @@ Highlighter = Backbone.View.extend({
this.highlightedObject = null;
this.index = null;
this.direction = null;
this.position = null;
this.hide();
},
......@@ -69,6 +70,7 @@ Highlighter = Backbone.View.extend({
var highlightedPos = highlighted.myParent.calcHighlighterPosition(intersection.face, intersection.point);
this.index = highlightedPos.index;
this.position = highlightedPos.position;
if (!highlightedPos.direction) {//may be hovering over a face that we shouldn't highlight
this.hide();
return;
......@@ -230,6 +232,13 @@ GIKHighlighter = Highlighter.extend({
this.mesh.rotation.set(0, 0,0);
this.mesh.translateX(-this.mesh.scale.x/2+this.mesh.scale.z/2);
}
},
updateGikLength: function(scale){
this.updateScale(scale);
this._setPosition(this.position, this.direction);//position of center point
this._setRotation(this.direction, this.index);
dmaGlobals.three.render();
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment