From efa0f27b8b4f6fbf16b2dc7aadf8164a7a0e3e97 Mon Sep 17 00:00:00 2001 From: Ben Morrow Date: Sun, 18 Aug 2013 21:22:28 -0700 Subject: [PATCH] Update DriveableCrossSections to show knob values live --- BenMorrow.pde | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/BenMorrow.pde b/BenMorrow.pde index 9294250..c632b8d 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -151,13 +151,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 +182,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(); } } -- 2.34.1