class DriveableCrossSections extends CrossSections
{
- BasicParameter xd = new BasicParameter("XD", 1.0);
- BasicParameter yd = new BasicParameter("YD", 1.0);
- BasicParameter zd = new BasicParameter("ZD", 1.0);
+ BasicParameter xd;
+ BasicParameter yd;
+ BasicParameter zd;
+ BasicParameter mode;
DriveableCrossSections(GLucose glucose) {
super(glucose);
public void addParams()
{
+ mode = new BasicParameter("Mode", 0.0);
+ xd = new BasicParameter("XD", 0.0);
+ yd = new BasicParameter("YD", 0.0);
+ zd = new BasicParameter("ZD", 0.0);
+ addParameter(mode);
addParameter(xd);
addParameter(yd);
addParameter(zd);
addParameter(zw);
}
+ public void onParameterChanged(LXParameter p) {
+ if(p == mode)
+ {
+ if(interactive())
+ {
+ xd.setValue(x.getValue()/200);
+ yd.setValue(y.getValue()/200);
+ zd.setValue(z.getValue()/100);
+ }
+ }
+ }
+ boolean interactive()
+ {
+ return Math.round(mode.getValuef())>0.5;
+ }
public void updateXYZVals()
{
- xv = xd.getValuef();
- yv = yd.getValuef();
- zv = zd.getValuef();
+ if(interactive())
+ {
+ xv = xd.getValuef()*200;
+ yv = yd.getValuef()*200;
+ zv = zd.getValuef()*100;
+ }else{
+ super.updateXYZVals();
+ }
}
}
\ No newline at end of file
((Granim) g).update();
}
List<Point> drawList = model.points.subList(Math.min(g.position,colors.length-1), Math.min(g.position + g.width(),colors.length-1));
- println("drawlistsize "+drawList.size());
+ //println("drawlistsize "+drawList.size());
gbuffer = g.graphicBuffer.toArray(new Integer[0]);