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

animation working

parent 533a9a61
Branches
No related tags found
No related merge requests found
...@@ -183,6 +183,7 @@ Assembler = Backbone.Model.extend({ ...@@ -183,6 +183,7 @@ Assembler = Backbone.Model.extend({
_stockSimulation: function(){ _stockSimulation: function(){
if (dmaGlobals.appState.get("stockSimulationPlaying")){ if (dmaGlobals.appState.get("stockSimulationPlaying")){
dmaGlobals.three.startAnimationLoop();
var currentLine = this.get("simLineNumber"); var currentLine = this.get("simLineNumber");
if (currentLine == 0) dmaGlobals.lattice.hideCells(); if (currentLine == 0) dmaGlobals.lattice.hideCells();
var allLines = this.get("dataOut").split("\n"); var allLines = this.get("dataOut").split("\n");
...@@ -199,6 +200,7 @@ Assembler = Backbone.Model.extend({ ...@@ -199,6 +200,7 @@ Assembler = Backbone.Model.extend({
this.resetSimulation(); this.resetSimulation();
} }
} else { } else {
dmaGlobals.three.stopAnimationLoop();
this.get("machine").pause(); this.get("machine").pause();
} }
......
...@@ -92,7 +92,6 @@ Machine.prototype._animateMesh = function(mesh, axis, speed, target, callback){ ...@@ -92,7 +92,6 @@ Machine.prototype._animateMesh = function(mesh, axis, speed, target, callback){
var direction = 1; var direction = 1;
if (target-mesh.position[axis] < 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 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 var simSpeed = 100/dmaGlobals.assembler.get("simSpeed");//1/10th of sec
this._incrementalMove(mesh, axis, increment, target, direction, callback, simSpeed); this._incrementalMove(mesh, axis, increment, target, direction, callback, simSpeed);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment