Commit ca972d08 authored by amandaghassaei's avatar amandaghassaei

switching integration types supported

parent bca57784
...@@ -391,6 +391,7 @@ function initControls(globals){ ...@@ -391,6 +391,7 @@ function initControls(globals){
}); });
setRadio("integrationType", globals.integrationType, function(val){ setRadio("integrationType", globals.integrationType, function(val){
globals.dynamicSolver.reset();
globals.integrationType = val; globals.integrationType = val;
}); });
...@@ -459,10 +460,6 @@ function initControls(globals){ ...@@ -459,10 +460,6 @@ function initControls(globals){
$("#deltaT").html(val.toFixed(4)); $("#deltaT").html(val.toFixed(4));
} }
setLink("#resetDynamicSim", function(){
globals.shouldResetDynamicSim = true;
});
setLink(".loadFile", function(e){ setLink(".loadFile", function(e){
$("#fileSelector").click(); $("#fileSelector").click();
$(e.target).blur(); $(e.target).blur();
......
...@@ -63,7 +63,7 @@ function initDynamicSolver(globals){ ...@@ -63,7 +63,7 @@ function initDynamicSolver(globals){
function reset(){ function reset(){
globals.gpuMath.step("zeroTexture", [], "u_position"); globals.gpuMath.step("zeroTexture", [], "u_position");
globals.gpuMath.step("zeroTexture", [], "u_lastPosition"); globals.gpuMath.step("zeroTexture", [], "u_lastPosition");
if (globals.integrationType == "verlet") globals.gpuMath.step("zeroTexture", [], "u_lastLastPosition"); globals.gpuMath.step("zeroTexture", [], "u_lastLastPosition");
globals.gpuMath.step("zeroTexture", [], "u_velocity"); globals.gpuMath.step("zeroTexture", [], "u_velocity");
globals.gpuMath.step("zeroTexture", [], "u_lastVelocity"); globals.gpuMath.step("zeroTexture", [], "u_lastVelocity");
globals.gpuMath.step("zeroThetaTexture", ["u_lastTheta"], "u_theta"); globals.gpuMath.step("zeroThetaTexture", ["u_lastTheta"], "u_theta");
......
...@@ -29,7 +29,7 @@ function initGlobals(){ ...@@ -29,7 +29,7 @@ function initGlobals(){
forceHasChanged: false, forceHasChanged: false,
materialHasChanged: false, materialHasChanged: false,
creaseMaterialHasChanged: false, creaseMaterialHasChanged: false,
shouldResetDynamicSim: false, shouldResetDynamicSim: false,//not used
shouldChangeCreasePercent: false, shouldChangeCreasePercent: false,
nodePositionHasChanged: false, nodePositionHasChanged: false,
shouldZeroDynamicVelocity: false, shouldZeroDynamicVelocity: false,
......
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