Commit 3e50d17b authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent 4d55cf9b
......@@ -34,13 +34,11 @@ function initControls(globals){
}
}
};
dynamicSimVisCallback(globals.dynamicSimVisible);
setCheckbox("#dynamic", globals.dynamicSimVisible, function(val){
globals.dynamicSimVisible = val;
dynamicSimVisCallback(val);
setCheckbox("#dynamic", globals.simType == "dynamic", function(val){
globals.simType = val;
});
setCheckbox("#static", globals.staticSimVisible, function(val){
globals.staticSimVisible = val;
setCheckbox("#static", globals.simType == "static", function(val){
globals.simType = val;
});
setCheckbox("#schematic", globals.schematicVisible, function(val){
globals.schematicVisible = val;
......@@ -92,7 +90,7 @@ function initControls(globals){
globals.colorMode = val;
if (val == "color") {
$("#coloredMaterialOptions").show();
globals.dynamicModel.setMeshMaterial();
globals.model.setMeshMaterial();
}
else $("#coloredMaterialOptions").hide();
......
......@@ -30,8 +30,6 @@ function initDynamicModel(globals){
var theta;//[theta, w, normalIndex1, normalIndex2]
var lastTheta;//[theta, w, normalIndex1, normalIndex2]
var inited = false;
function syncNodesAndEdges(firstTime){
nodes = globals.model.getNodes();
edges = globals.model.getEdges();
......@@ -42,8 +40,6 @@ function initDynamicModel(globals){
if (firstTime === undefined) firstTime = false;
initTexturesAndPrograms(globals.gpuMath, firstTime);
steps = parseInt(setSolveParams());
inited = true;
}
var steps;
......@@ -379,6 +375,7 @@ function initDynamicModel(globals){
}
function setCreasePercent(percent){
if (!programsInited) return;
globals.gpuMath.setProgram("velocityCalc");
globals.gpuMath.setUniformForProgram("velocityCalc", "u_creasePercent", percent, "1f");
}
......@@ -474,6 +471,7 @@ function initDynamicModel(globals){
updateExternalForces();
updateCreasesMeta(true);
updateCreaseVectors();
setCreasePercent(globals.creasePercent);
}
return {
......
......@@ -17,7 +17,7 @@ function initGlobals(){
creaseMaterialHasChanged: false,
shouldResetDynamicSim: false,
shouldChangeCreasePercent: false,
shouldSyncWithModel: true,
shouldSyncWithModel: false,
nodePositionHasChanged: false,
//3d vis
......
Supports Markdown
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