Commit 5ddd8534 authored by amandaghassaei's avatar amandaghassaei

dynamic sim vis

parent f60a89c8
...@@ -21,11 +21,17 @@ function initControls(globals){ ...@@ -21,11 +21,17 @@ function initControls(globals){
var dynamicSimVisCallback = function(val){ var dynamicSimVisCallback = function(val){
if (val) { if (val) {
$(".dynamicSim").show(); $(".dynamicSim").show();
if (globals.dynamicModel) globals.dynamicModel.resume(); if (globals.dynamicModel) {
globals.dynamicModel.resume();
globals.dynamicModel.setVisibility(true);
}
} }
else { else {
$(".dynamicSim").hide(); $(".dynamicSim").hide();
if (globals.dynamicModel) globals.dynamicModel.pause(); if (globals.dynamicModel) {
globals.dynamicModel.pause();
globals.dynamicModel.setVisibility(false);
}
} }
}; };
dynamicSimVisCallback(globals.dynamicSimVisible); dynamicSimVisCallback(globals.dynamicSimVisible);
......
...@@ -90,6 +90,7 @@ function initDynamicModel(globals){ ...@@ -90,6 +90,7 @@ function initDynamicModel(globals){
function setVisibility(state){ function setVisibility(state){
object3D.visible = state; object3D.visible = state;
globals.threeView.render();
} }
function solveStep(){ function solveStep(){
...@@ -420,6 +421,7 @@ function initDynamicModel(globals){ ...@@ -420,6 +421,7 @@ function initDynamicModel(globals){
updateMaterials:updateMaterials, updateMaterials:updateMaterials,
reset: reset, reset: reset,
pause: pause, pause: pause,
resume: resume resume: resume,
setVisibility: setVisibility
} }
} }
\ No newline at end of file
...@@ -88,6 +88,7 @@ function initThreeView(globals) { ...@@ -88,6 +88,7 @@ function initThreeView(globals) {
pauseFlag = false; pauseFlag = false;
animationRunning = false; animationRunning = false;
console.log("pausing animation"); console.log("pausing animation");
render();//for good measure
return; return;
} }
_loop(callback); _loop(callback);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment