void doUI() { drawGenome(meow,genomeAnchor); genomeAnchor=new position(25-genomeScroll.ratio()*(wWidth)*float(amount)*.5,50); genomeScroll.update(); noStroke(); fill(120,140,155); textFont(uiFont,20); textMode(CORNER); text("GENOME>PHENOME",10,450); if(rawr.nodes.length>=maxNodes) fill(160,120,120); else fill(120); textFont(uiFont,12); text("point mass: "+rawr.nodes.length,10,20); fill(120); text("spring tension: "+float(int(rawr.tension*1000))/1000,90,20); text("collision tension: "+float(int(rawr.collisionTension*1000))/1000,90,30); text("friction constant: "+FRICTION_FORCE,200,20); text("display mode: "+displayMode,200,30); if(selected!=null) text("selected node gene ID: "+selected.g.id,mouseX+10,mouseY); fill(150); textFont(uiFont,15); text("key",20,476); textFont(uiFont,12); if(key=='h') fill(120,220,190); else fill(150); text("'h' toggle UI",55,470); if(key=='1'||key=='2'||key=='3') fill(120,220,190); else fill(150); text("'1-3' display modes",55,488); /* if(key=='+') fill(220,190,190); else fill(150); text("'+' add node",55,488); */ if(key=='[') fill(220,190,190); else fill(150); text("'[' decrease tension",150,470); if(key==']') fill(220,190,190); else fill(150); text("']' increase tension",150,488); if(key=='g' || useGravity) fill(120,220,190); else fill(150); text("'g' toggle gravity",255,470); if(key=='c') fill(220,190,190); else fill(150); text("'c' create new",255,488); if(key=='s'||useSmooth) fill(220,190,190); else fill(150); text("'s' anti-alias",345,470); if(key=='m'||useMirror) fill(220,190,190); else fill(150); text("'m' mirror phenotype",345,488); /* for(int i=0;i0.01) rawr.tension-=0.005; if(key==']'&&rawr.tension<0.7) rawr.tension+=0.005; if(key=='c') { // playMode=false; selected=null; amount=int(random(minGenes,maxGenes)); rawr=new lattice(0); meow=new genome(amount); constructPhenome(rawr,meow); if(useMirror) mirror(rawr); } if(key=='1'||key=='2'||key=='3') displayMode=int(key)-48; if(key=='s') { if(useSmooth) { useSmooth=false; noSmooth(); } else { useSmooth=true; smooth(); } } if(key=='m') { if(useMirror==true) { useMirror=false; rawr=new lattice(0); constructPhenome(rawr,meow); } else { useMirror=true; rawr=new lattice(0); constructPhenome(rawr,meow); mirror(rawr); } } if(key=='r') { if(useRK) useRK=false; else useRK=true; } } void keyReleased() { key=' '; } void playMode() { if(rawr!=null&&rawr.nodes!=null) { if(selected==null) selected=rawr.nodes[0]; position mp=new position(mouseX,mouseY); for(int i=0;i