Commit d2587d80 authored by amandaghassaei's avatar amandaghassaei
Browse files

toggle user interaction

parent e7400a4d
......@@ -434,6 +434,10 @@
Compliant Static Simulation (not finished yet) <a class="about floatRight" href="#" id="aboutStaticSim"><span class="fui-question-circle"></span></a>
</label>
</div><br/>
<label class="checkbox" for="userInteractionEnabled">
<input id="userInteractionEnabled" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Allow User Interaction
</label><br/>
<b>Fold Settings:</b><br/><br/>
<div class="sliderInput" id="creasePercent">
<span class="label-slider">Angle (-1 to 1) : </span><div class="flat-slider ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content"></div>
......
......@@ -38,6 +38,8 @@ function init3DUI(globals) {
isDragging = true;
}
if (!globals.userInteractionEnabled) return;
e.preventDefault();
mouse.x = (e.clientX/window.innerWidth)*2-1;
mouse.y = - (e.clientY/window.innerHeight)*2+1;
......
......@@ -439,6 +439,10 @@ function initControls(globals){
globals.strainClip = val;
}, 0.0001, 100);
setCheckbox($("#userInteractionEnabled"), globals.userInteractionEnabled, function(val){
globals.userInteractionEnabled = val;
});
function setButtonGroup(id, callback){
$(id+" a").click(function(e){
e.preventDefault();
......
......@@ -53,7 +53,9 @@ function initGlobals(){
filename: null,
extension: null,
doublesidedSTL: false,
scale: 1
scale: 1,
userInteractionEnabled: false
};
......
......@@ -135,6 +135,7 @@ Node.prototype.highlight = function(){
};
Node.prototype.unhighlight = function(){
if (!this.object3D) return;
if (this.fixed) {
this.object3D.material = nodeMaterialFixed;
}
......
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