Commit 5ddd8534 authored by amandaghassaei's avatar amandaghassaei

dynamic sim vis

parent f60a89c8
......@@ -21,11 +21,17 @@ function initControls(globals){
var dynamicSimVisCallback = function(val){
if (val) {
$(".dynamicSim").show();
if (globals.dynamicModel) globals.dynamicModel.resume();
if (globals.dynamicModel) {
globals.dynamicModel.resume();
globals.dynamicModel.setVisibility(true);
}
}
else {
$(".dynamicSim").hide();
if (globals.dynamicModel) globals.dynamicModel.pause();
if (globals.dynamicModel) {
globals.dynamicModel.pause();
globals.dynamicModel.setVisibility(false);
}
}
};
dynamicSimVisCallback(globals.dynamicSimVisible);
......
......@@ -90,6 +90,7 @@ function initDynamicModel(globals){
function setVisibility(state){
object3D.visible = state;
globals.threeView.render();
}
function solveStep(){
......@@ -420,6 +421,7 @@ function initDynamicModel(globals){
updateMaterials:updateMaterials,
reset: reset,
pause: pause,
resume: resume
resume: resume,
setVisibility: setVisibility
}
}
\ No newline at end of file
......@@ -88,6 +88,7 @@ function initThreeView(globals) {
pauseFlag = false;
animationRunning = false;
console.log("pausing animation");
render();//for good measure
return;
}
_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