diff --git a/js/cam/Assembler.js b/js/cam/Assembler.js index c582661731cbc44b470ee0a4eb0a695df9b4202e..2e402e9a159277430eda2a1734fe0f07122f0436 100644 --- a/js/cam/Assembler.js +++ b/js/cam/Assembler.js @@ -80,7 +80,7 @@ Assembler = Backbone.Model.extend({ this._initOriginAndStock(); }, - selectMachine: function(machineName){ + selectMachine: function(machineName){//todo put this on event - that way you know it is a change if (!machineName) machineName = this.get("machineName"); if (this.get("machine")) this.get("machine").destroy(); if (machineName == "shopbot"){ diff --git a/js/cam/Machine.js b/js/cam/Machine.js index 6d4c71d445d0b667cb50f5c09045d125a232eaaa..88158f8b98993376870eb7964fdcc79c1b8d9819 100644 --- a/js/cam/Machine.js +++ b/js/cam/Machine.js @@ -63,13 +63,13 @@ Machine.prototype.pause = function(){ }; Machine.prototype._animateMesh = function(mesh, axis, speed, target, callback){ - var increment = 0.1/speed;//based on 1/10th of sec + var increment = speed/10;//based on 1/10th of sec if (increment == 0) { if (callback) callback(); return; } var direction = 1; - if (increment<0) direction = -1; + if (target-mesh.position[axis] < 0) direction = -1; increment = Math.max(Math.abs(increment), 0.00001)*direction;//need to put a min on the increment - other wise this stall out with floating pt tol dmaGlobals.three.startAnimationLoop(); var simSpeed = 100/dmaGlobals.assembler.get("simSpeed");//1/10th of sec