X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=BenMorrow.pde;h=e610155120eced021237936582d2e4758d8c477e;hb=ae80d37a7fc19c8bce45067cdcf4e041808f9339;hp=9294250cda3e5740a688ccfe61724de74c28c0dd;hpb=b0064ed7eb5d5d886cec459c7839221c3b125f58;p=SugarCubes.git diff --git a/BenMorrow.pde b/BenMorrow.pde index 9294250..e610155 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -135,15 +135,8 @@ class DriveableCrossSections extends CrossSections addParameter(xd); addParameter(yd); addParameter(zd); - addParameter(xr); - addParameter(yr); - addParameter(zr); - addParameter(xw); - addParameter(xl); - addParameter(yl); - addParameter(zl); - addParameter(yw); - addParameter(zw); + + super.addParams(); } public void onParameterChanged(LXParameter p) { @@ -151,13 +144,27 @@ class DriveableCrossSections extends CrossSections { if(interactive()) { - xd.setValue(x.getValue()/200); - yd.setValue(y.getValue()/200); - zd.setValue(z.getValue()/100); + copyValuesToKnobs(); + }else{ + copyKnobsToValues(); } } } + void copyValuesToKnobs() + { + xd.setValue(x.getValue()/200); + yd.setValue(y.getValue()/115); + zd.setValue(z.getValue()/100); + } + + void copyKnobsToValues() + { + x.setValue(xd.getValue()*200); + y.setValue(yd.getValue()*115); + z.setValue(zd.getValue()*100); + } + boolean interactive() { return Math.round(mode.getValuef())>0.5; @@ -168,10 +175,11 @@ class DriveableCrossSections extends CrossSections if(interactive()) { xv = xd.getValuef()*200; - yv = yd.getValuef()*200; + yv = yd.getValuef()*115; zv = zd.getValuef()*100; }else{ super.updateXYZVals(); + copyValuesToKnobs(); } }