Commit c726ffd5 authored by amandaghassaei's avatar amandaghassaei
Browse files

change num steps

parent 2da50486
......@@ -536,7 +536,8 @@
</div><br/>
<b>Animation Settings:</b><br/>
<div class="indent">
<span class="smallTxt">&Delta; t = <span id="deltaT"></span> seconds</span><br/><br/>
<span class="smallTxt">&Delta; t = <span id="deltaT"></span> seconds</span><br/>
<span class="smallTxt">Num steps per render: &nbsp;&nbsp;<input id="numStepsPerRender" value="" placeholder="" class="int form-control" type="text"></span><br/><br/>
<a href="#" id="shouldCenterGeo" class="floatRight btn btn-lg btn-default">Re-center geometry</a>
</div>
<div class="extraSpace"></div>
......
......@@ -275,6 +275,10 @@ function initControls(globals){
globals.shouldCenterGeo = true;
});
setInput("#numStepsPerRender", globals.numSteps, function(val){
globals.numSteps = val;
}, 1);
function setButtonGroup(id, callback){
$(id+" a").click(function(e){
e.preventDefault();
......
......@@ -44,10 +44,9 @@ function initDynamicSolver(globals){
initTypedArrays();
initTexturesAndPrograms(globals.gpuMath);
steps = parseInt(setSolveParams());
setSolveParams();
}
var steps;
var programsInited = false;//flag for initial setup
var textureDim = 0;
......@@ -111,7 +110,7 @@ function initDynamicSolver(globals){
}
}
if (_numSteps == undefined) _numSteps = steps;
if (_numSteps == undefined) _numSteps = globals.numSteps;
for (var j=0;j<_numSteps;j++){
solveStep();
}
......@@ -229,7 +228,6 @@ function initDynamicSolver(globals){
function setSolveParams(){
var dt = calcDt()/2;//todo factor of ten?
$("#deltaT").html(dt);
var numSteps = 0.5/dt;
globals.gpuMath.setProgram("thetaCalc");
globals.gpuMath.setUniformForProgram("thetaCalc", "u_dt", dt, "1f");
globals.gpuMath.setProgram("velocityCalc");
......@@ -237,7 +235,6 @@ function initDynamicSolver(globals){
globals.gpuMath.setProgram("positionCalc");
globals.gpuMath.setUniformForProgram("positionCalc", "u_dt", dt, "1f");
globals.controls.setDeltaT(dt);
return numSteps;
}
function calcDt(){
......
......@@ -67,7 +67,9 @@ function initGlobals(){
pausedForPatternView: false,
userInteractionEnabled: false,
vrEnabled: false
vrEnabled: false,
numSteps: 100
};
......
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